Skip to content

Commit

Permalink
drm/fb-helper: generic: Don't take module ref for fbcon
Browse files Browse the repository at this point in the history
It's now safe to let fbcon unbind automatically on fbdev unregister.
The crash problem was fixed in commit 2122b40
("fbdev: fbcon: Fix unregister crash when more than one framebuffer")

Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/20190210131039.52664-13-noralf@tronnes.org
  • Loading branch information
Noralf Trønnes committed Feb 21, 2019
1 parent eb73e1d commit 6ab20a0
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions drivers/gpu/drm/drm_fb_helper.c
Original file line number Diff line number Diff line change
Expand Up @@ -3024,7 +3024,8 @@ static int drm_fbdev_fb_open(struct fb_info *info, int user)
{
struct drm_fb_helper *fb_helper = info->par;

if (!try_module_get(fb_helper->dev->driver->fops->owner))
/* No need to take a ref for fbcon because it unbinds on unregister */
if (user && !try_module_get(fb_helper->dev->driver->fops->owner))
return -ENODEV;

return 0;
Expand All @@ -3034,7 +3035,8 @@ static int drm_fbdev_fb_release(struct fb_info *info, int user)
{
struct drm_fb_helper *fb_helper = info->par;

module_put(fb_helper->dev->driver->fops->owner);
if (user)
module_put(fb_helper->dev->driver->fops->owner);

return 0;
}
Expand Down

0 comments on commit 6ab20a0

Please sign in to comment.