提交 0f58411d 编写于 作者: I Ilia Mirkin 提交者: Dave Airlie

drm: don't double-free on driver load error

All instances of drm_dev_register are followed by drm_dev_free on
failure. Don't free dev->control/render/primary on failure, as they will
be freed by drm_dev_free since commit 8f6599da (drm: delay minor
destruction to drm_dev_free()). Instead unplug them.
Signed-off-by: NIlia Mirkin <imirkin@alum.mit.edu>
Reported-and-tested-by: NBruno Prémont <bonbons@linux-vserver.org>
Reviewed-by: NDavid Herrmann <dh.herrmann@gmail.com>
Signed-off-by: NDave Airlie <airlied@redhat.com>
上级 0ca9fff7
......@@ -566,11 +566,11 @@ int drm_dev_register(struct drm_device *dev, unsigned long flags)
if (dev->driver->unload)
dev->driver->unload(dev);
err_primary_node:
drm_put_minor(dev->primary);
drm_unplug_minor(dev->primary);
err_render_node:
drm_put_minor(dev->render);
drm_unplug_minor(dev->render);
err_control_node:
drm_put_minor(dev->control);
drm_unplug_minor(dev->control);
err_agp:
if (dev->driver->bus->agp_destroy)
dev->driver->bus->agp_destroy(dev);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册