drm: fix double drm_put_minor() in fail paths
Subsystems (2)
PATCH 1/1 drm: fix double drm_put_minor() in fail paths
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.
--- drivers/gpu/drm/drm_stub.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/gpu/drm/drm_stub.c +3 -0
@@ -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);
Signature · 1 line
1.8.4.2
Quoted 3 lines · Rob Clark
If driver failed to load (for example, -EPROBE_DEFER), we'd end up doing
drm_put_minor()both fromdrm_dev_register()anddrm_dev_free(), the second time with a bogus pointer.
FYI, I sent a similar patch ~week ago that changed put_minor into unplug_minor per David Herrmann's advice.
Quoted 31 lines
Signed-off-by Rob Clark <[email protected]>--- drivers/gpu/drm/drm_stub.c | 3 +++ 1 file changed, 3 insertions(+)drivers/gpu/drm/drm_stub.c +3
-1@@ -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
_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
Quoted 7 lines · Ilia Mirkin
Quoted 3 lines · Rob Clark
If driver failed to load (for example, -EPROBE_DEFER), we'd end up doing
drm_put_minor()both fromdrm_dev_register()anddrm_dev_free(), the second time with a bogus pointer.FYI, I sent a similar patch ~week ago that changed
put_minorintounplug_minorper David Herrmann's advice.
ahh, ok.. I didn't see it, but if it fixes the same issue we can drop my patch..
BR,
-R
Quoted 31 lines
Quoted 31 lines
Signed-off-by Rob Clark <[email protected]>--- drivers/gpu/drm/drm_stub.c | 3 +++ 1 file changed, 3 insertions(+)drivers/gpu/drm/drm_stub.c +3
-1@@ -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
_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel