diff options
Diffstat (limited to 'drivers/media')
-rw-r--r-- | drivers/media/dvb/dvb-core/dvbdev.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/media/dvb/dvb-core/dvbdev.c b/drivers/media/dvb/dvb-core/dvbdev.c index 65d69665f1fc..6a32680dbb1b 100644 --- a/drivers/media/dvb/dvb-core/dvbdev.c +++ b/drivers/media/dvb/dvb-core/dvbdev.c | |||
@@ -79,6 +79,10 @@ static int dvb_device_open(struct inode *inode, struct file *file) | |||
79 | file->private_data = dvbdev; | 79 | file->private_data = dvbdev; |
80 | old_fops = file->f_op; | 80 | old_fops = file->f_op; |
81 | file->f_op = fops_get(dvbdev->fops); | 81 | file->f_op = fops_get(dvbdev->fops); |
82 | if (file->f_op == NULL) { | ||
83 | file->f_op = old_fops; | ||
84 | goto fail; | ||
85 | } | ||
82 | if(file->f_op->open) | 86 | if(file->f_op->open) |
83 | err = file->f_op->open(inode,file); | 87 | err = file->f_op->open(inode,file); |
84 | if (err) { | 88 | if (err) { |
@@ -90,6 +94,7 @@ static int dvb_device_open(struct inode *inode, struct file *file) | |||
90 | unlock_kernel(); | 94 | unlock_kernel(); |
91 | return err; | 95 | return err; |
92 | } | 96 | } |
97 | fail: | ||
93 | up_read(&minor_rwsem); | 98 | up_read(&minor_rwsem); |
94 | unlock_kernel(); | 99 | unlock_kernel(); |
95 | return -ENODEV; | 100 | return -ENODEV; |