[PATCH] drm: fix double drm_put_minor() in fail paths
Rob Clark
robdclark at gmail.com
Thu Dec 12 09:07:39 PST 2013
If driver failed to load (for example, -EPROBE_DEFER), we'd end up doing
drm_put_minor() both from drm_dev_register() and drm_dev_free(), the
second time with a bogus pointer.
Signed-off-by: Rob Clark <robdclark at gmail.com>
---
drivers/gpu/drm/drm_stub.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/gpu/drm/drm_stub.c b/drivers/gpu/drm/drm_stub.c
index f53d524..f245d99 100644
--- a/drivers/gpu/drm/drm_stub.c
+++ b/drivers/gpu/drm/drm_stub.c
@@ -567,10 +567,13 @@ err_unload:
dev->driver->unload(dev);
err_primary_node:
drm_put_minor(dev->primary);
+ dev->primary = NULL;
err_render_node:
drm_put_minor(dev->render);
+ dev->render = NULL;
err_control_node:
drm_put_minor(dev->control);
+ dev->control = NULL;
err_agp:
if (dev->driver->bus->agp_destroy)
dev->driver->bus->agp_destroy(dev);
--
1.8.4.2
More information about the dri-devel
mailing list