Skip to content

Commit

Permalink
drm: cleanup debugfs in drm_unplug_minor()
Browse files Browse the repository at this point in the history
There is no reason to delay debugfs-cleanup to drm_put_minor(). We should
forbid any access to debugfs files once the device is dead. Chances they
oops once a card was unplugged are very high, anyway.

Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
  • Loading branch information
David Herrmann authored and Dave Airlie committed Nov 6, 2013
1 parent a99ee45 commit 865fb47
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions drivers/gpu/drm/drm_stub.c
Original file line number Diff line number Diff line change
Expand Up @@ -341,6 +341,10 @@ static void drm_unplug_minor(struct drm_minor *minor)
if (!minor || !device_is_registered(minor->kdev))
return;

#if defined(CONFIG_DEBUG_FS)
drm_debugfs_cleanup(minor);
#endif

drm_sysfs_device_remove(minor);
}

Expand All @@ -360,10 +364,6 @@ static void drm_put_minor(struct drm_minor *minor)

DRM_DEBUG("release secondary minor %d\n", minor->index);

#if defined(CONFIG_DEBUG_FS)
drm_debugfs_cleanup(minor);
#endif

drm_unplug_minor(minor);

idr_remove(&drm_minors_idr, minor->index);
Expand Down

0 comments on commit 865fb47

Please sign in to comment.