提交 fc7f687a 编写于 作者: J Jonathan Corbet

fbmem: cdev lock_kernel() pushdown

Signed-off-by: NJonathan Corbet <corbet@lwn.net>
上级 5794e1b1
...@@ -1326,20 +1326,27 @@ fb_open(struct inode *inode, struct file *file) ...@@ -1326,20 +1326,27 @@ fb_open(struct inode *inode, struct file *file)
if (fbidx >= FB_MAX) if (fbidx >= FB_MAX)
return -ENODEV; return -ENODEV;
lock_kernel();
#ifdef CONFIG_KMOD #ifdef CONFIG_KMOD
if (!(info = registered_fb[fbidx])) if (!(info = registered_fb[fbidx]))
try_to_load(fbidx); try_to_load(fbidx);
#endif /* CONFIG_KMOD */ #endif /* CONFIG_KMOD */
if (!(info = registered_fb[fbidx])) if (!(info = registered_fb[fbidx])) {
return -ENODEV; res = -ENODEV;
if (!try_module_get(info->fbops->owner)) goto out;
return -ENODEV; }
if (!try_module_get(info->fbops->owner)) {
res = -ENODEV;
goto out;
}
file->private_data = info; file->private_data = info;
if (info->fbops->fb_open) { if (info->fbops->fb_open) {
res = info->fbops->fb_open(info,1); res = info->fbops->fb_open(info,1);
if (res) if (res)
module_put(info->fbops->owner); module_put(info->fbops->owner);
} }
out:
unlock_kernel();
return res; return res;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册