From: Jonathan Corbet Date: Thu, 15 May 2008 22:30:36 +0000 (-0600) Subject: fbmem: cdev lock_kernel() pushdown X-Git-Tag: v2.6.27-rc1~1103^2~112 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fc7f687a6878e19f7ce58cb8a65659cd2730b586;p=linux-2.6 fbmem: cdev lock_kernel() pushdown Signed-off-by: Jonathan Corbet --- diff --git a/drivers/video/fbmem.c b/drivers/video/fbmem.c index 776f7fcd2f..33ebdb198d 100644 --- a/drivers/video/fbmem.c +++ b/drivers/video/fbmem.c @@ -1326,20 +1326,27 @@ fb_open(struct inode *inode, struct file *file) if (fbidx >= FB_MAX) return -ENODEV; + lock_kernel(); #ifdef CONFIG_KMOD if (!(info = registered_fb[fbidx])) try_to_load(fbidx); #endif /* CONFIG_KMOD */ - if (!(info = registered_fb[fbidx])) - return -ENODEV; - if (!try_module_get(info->fbops->owner)) - return -ENODEV; + if (!(info = registered_fb[fbidx])) { + res = -ENODEV; + goto out; + } + if (!try_module_get(info->fbops->owner)) { + res = -ENODEV; + goto out; + } file->private_data = info; if (info->fbops->fb_open) { res = info->fbops->fb_open(info,1); if (res) module_put(info->fbops->owner); } +out: + unlock_kernel(); return res; }