diff options
Diffstat (limited to 'drivers/video/fbmem.c')
-rw-r--r-- | drivers/video/fbmem.c | 15 |
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) | |||
1326 | 1326 | ||
1327 | if (fbidx >= FB_MAX) | 1327 | if (fbidx >= FB_MAX) |
1328 | return -ENODEV; | 1328 | return -ENODEV; |
1329 | lock_kernel(); | ||
1329 | #ifdef CONFIG_KMOD | 1330 | #ifdef CONFIG_KMOD |
1330 | if (!(info = registered_fb[fbidx])) | 1331 | if (!(info = registered_fb[fbidx])) |
1331 | try_to_load(fbidx); | 1332 | try_to_load(fbidx); |
1332 | #endif /* CONFIG_KMOD */ | 1333 | #endif /* CONFIG_KMOD */ |
1333 | if (!(info = registered_fb[fbidx])) | 1334 | if (!(info = registered_fb[fbidx])) { |
1334 | return -ENODEV; | 1335 | res = -ENODEV; |
1335 | if (!try_module_get(info->fbops->owner)) | 1336 | goto out; |
1336 | return -ENODEV; | 1337 | } |
1338 | if (!try_module_get(info->fbops->owner)) { | ||
1339 | res = -ENODEV; | ||
1340 | goto out; | ||
1341 | } | ||
1337 | file->private_data = info; | 1342 | file->private_data = info; |
1338 | if (info->fbops->fb_open) { | 1343 | if (info->fbops->fb_open) { |
1339 | res = info->fbops->fb_open(info,1); | 1344 | res = info->fbops->fb_open(info,1); |
1340 | if (res) | 1345 | if (res) |
1341 | module_put(info->fbops->owner); | 1346 | module_put(info->fbops->owner); |
1342 | } | 1347 | } |
1348 | out: | ||
1349 | unlock_kernel(); | ||
1343 | return res; | 1350 | return res; |
1344 | } | 1351 | } |
1345 | 1352 | ||