summaryrefslogtreecommitdiffstats
path: root/drivers/video/fbmem.c
diff options
context:
space:
mode:
authorJonathan Corbet <corbet@lwn.net>2008-05-16 00:30:36 +0200
committerJonathan Corbet <corbet@lwn.net>2008-06-20 22:05:50 +0200
commitfc7f687a6878e19f7ce58cb8a65659cd2730b586 (patch)
tree7cf4b6761654bf0e8e85fb813968be332fab3099 /drivers/video/fbmem.c
parentdvb: cdev lock_kernel() pushdown (diff)
downloadlinux-fc7f687a6878e19f7ce58cb8a65659cd2730b586.tar.xz
linux-fc7f687a6878e19f7ce58cb8a65659cd2730b586.zip
fbmem: cdev lock_kernel() pushdown
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Diffstat (limited to '')
-rw-r--r--drivers/video/fbmem.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/drivers/video/fbmem.c b/drivers/video/fbmem.c
index 776f7fcd2fbf..33ebdb198daf 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;
}