Skip to content

Commit

Permalink
drm: check for !kdev in drm_unplug_minor()
Browse files Browse the repository at this point in the history
We moved minor deallocation to drm_dev_free() in:
  commit 8f6599d
  Author: David Herrmann <[email protected]>
  Date:   Sun Oct 20 18:55:45 2013 +0200

      drm: delay minor destruction to drm_dev_free()

However, this causes a call to drm_unplug_minor(), which should just do
nothing as drm_dev_unregister() already called this.

But a separate patch caused kdev lifetime changes:
  commit 5bdebb1
  Author: Dave Airlie <[email protected]>
  Date:   Fri Oct 11 14:07:25 2013 +1000

      drm/sysfs: sort out minor and connector device object lifetimes.

Thus making our dev_is_registered() call useles (and even segfault if it
is NULL). Replace it with a simple !kdev test and we're fine.

Reported-by: Huax Lu <[email protected]>
Reported-by: Daniel Vetter <[email protected]>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=71208
Tested-by: lu hua <[email protected]>
Reviewed-by: Daniel Vetter <[email protected]>
Signed-off-by: David Herrmann <[email protected]>
Signed-off-by: Dave Airlie <[email protected]>
  • Loading branch information
David Herrmann authored and airlied committed Nov 15, 2013
1 parent 0846c72 commit a348335
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/gpu/drm/drm_stub.c
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ static int drm_get_minor(struct drm_device *dev, struct drm_minor **minor,
*/
static void drm_unplug_minor(struct drm_minor *minor)
{
if (!minor || !device_is_registered(minor->kdev))
if (!minor || !minor->kdev)
return;

#if defined(CONFIG_DEBUG_FS)
Expand Down

0 comments on commit a348335

Please sign in to comment.