diff options
author | Jonathan Gray <jsg@cvs.openbsd.org> | 2019-07-11 01:50:56 +0000 |
---|---|---|
committer | Jonathan Gray <jsg@cvs.openbsd.org> | 2019-07-11 01:50:56 +0000 |
commit | ec20ba0230ddc94cd1091c6beef4c1c68a5c0a61 (patch) | |
tree | 090105c2213cd82d4be0f960edeb59312445771d /sys | |
parent | e1d1e775a33a475dcd3ae77f7760fbec38d9143e (diff) |
drm/fb-helper: generic: Don't take module ref for fbcon
From Noralf Tronnes
e9fde78c3a4f7f374ffe589771f08e119d0879aa in linux 4.19.y/4.19.58
6ab20a05f4c7ed45632e24d5397d6284e192567d in mainline linux
Diffstat (limited to 'sys')
-rw-r--r-- | sys/dev/pci/drm/drm_fb_helper.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/dev/pci/drm/drm_fb_helper.c b/sys/dev/pci/drm/drm_fb_helper.c index 368d7f2a83f..8e134187f6c 100644 --- a/sys/dev/pci/drm/drm_fb_helper.c +++ b/sys/dev/pci/drm/drm_fb_helper.c @@ -3014,7 +3014,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; @@ -3024,7 +3025,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; } |