提交 1541fa85 编写于 作者: J Jesper Juhl 提交者: Ben Skeggs

drm/nouveau: do not leak in nv20_graph_create

If we return due to an unknown chipset in
drivers/gpu/drm/nouveau/nv20_graph.c:nv20_graph_create() we'll leak the
memory allocated to 'pgraph'.

This patch should fix the leak.
Signed-off-by: NJesper Juhl <jj@chaosbits.net>
Reviewed-by: NMarcin Slusarz <marcin.slusarz@gmail.com>
Signed-off-by: NBen Skeggs <bskeggs@redhat.com>
上级 88c8431c
......@@ -753,6 +753,7 @@ nv20_graph_create(struct drm_device *dev)
break;
default:
NV_ERROR(dev, "PGRAPH: unknown chipset\n");
kfree(pgraph);
return 0;
}
} else {
......@@ -774,6 +775,7 @@ nv20_graph_create(struct drm_device *dev)
break;
default:
NV_ERROR(dev, "PGRAPH: unknown chipset\n");
kfree(pgraph);
return 0;
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册