All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm: fix double drm_put_minor() in fail paths
@ 2013-12-12 17:07 Rob Clark
  2013-12-12 17:12 ` Ilia Mirkin
  0 siblings, 1 reply; 3+ messages in thread
From: Rob Clark @ 2013-12-12 17:07 UTC (permalink / raw)
  To: dri-devel

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@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

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-12-12 17:17 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-12-12 17:07 [PATCH] drm: fix double drm_put_minor() in fail paths Rob Clark
2013-12-12 17:12 ` Ilia Mirkin
2013-12-12 17:17   ` Rob Clark

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.