diff options
Diffstat (limited to 'drivers/video/fbmem.c')
-rw-r--r-- | drivers/video/fbmem.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/video/fbmem.c b/drivers/video/fbmem.c index 83e259413115..32a9b69becc5 100644 --- a/drivers/video/fbmem.c +++ b/drivers/video/fbmem.c | |||
@@ -1234,6 +1234,7 @@ fb_open(struct inode *inode, struct file *file) | |||
1234 | return -ENODEV; | 1234 | return -ENODEV; |
1235 | if (!try_module_get(info->fbops->owner)) | 1235 | if (!try_module_get(info->fbops->owner)) |
1236 | return -ENODEV; | 1236 | return -ENODEV; |
1237 | file->private_data = info; | ||
1237 | if (info->fbops->fb_open) { | 1238 | if (info->fbops->fb_open) { |
1238 | res = info->fbops->fb_open(info,1); | 1239 | res = info->fbops->fb_open(info,1); |
1239 | if (res) | 1240 | if (res) |
@@ -1245,11 +1246,9 @@ fb_open(struct inode *inode, struct file *file) | |||
1245 | static int | 1246 | static int |
1246 | fb_release(struct inode *inode, struct file *file) | 1247 | fb_release(struct inode *inode, struct file *file) |
1247 | { | 1248 | { |
1248 | int fbidx = iminor(inode); | 1249 | struct fb_info * const info = file->private_data; |
1249 | struct fb_info *info; | ||
1250 | 1250 | ||
1251 | lock_kernel(); | 1251 | lock_kernel(); |
1252 | info = registered_fb[fbidx]; | ||
1253 | if (info->fbops->fb_release) | 1252 | if (info->fbops->fb_release) |
1254 | info->fbops->fb_release(info,1); | 1253 | info->fbops->fb_release(info,1); |
1255 | module_put(info->fbops->owner); | 1254 | module_put(info->fbops->owner); |