aboutsummaryrefslogtreecommitdiff
path: root/drivers/media
diff options
context:
space:
mode:
authorDan Carpenter <error27@gmail.com>2010-05-05 03:01:30 -0300
committerMauro Carvalho Chehab <mchehab@redhat.com>2010-05-19 12:59:14 -0300
commitaab9796f5580a988c46c130a727cdc398a05317b (patch)
treedc03abc84addf0ba87bb1da79ac4842ea4c9cefc /drivers/media
parentb9245d80c375b93db79475ca231276e1fa5a7649 (diff)
V4L/DVB: s2255drv: return if vdev not found
The original code didn't handle the case where vdev was not found so I added a check for that. Signed-off-by: Dan Carpenter <error27@gmail.com> Cc: linux-dev@sensoray.com Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media')
-rw-r--r--drivers/media/video/s2255drv.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/media/video/s2255drv.c b/drivers/media/video/s2255drv.c
index ac9c40cf583..1f9a49e054a 100644
--- a/drivers/media/video/s2255drv.c
+++ b/drivers/media/video/s2255drv.c
@@ -1716,11 +1716,15 @@ static int s2255_open(struct file *file)
dprintk(1, "s2255: open called (dev=%s)\n",
video_device_node_name(vdev));
- for (i = 0; i < MAX_CHANNELS; i++)
+ for (i = 0; i < MAX_CHANNELS; i++) {
if (&dev->vdev[i] == vdev) {
cur_channel = i;
break;
}
+ }
+ if (i == MAX_CHANNELS)
+ return -ENODEV;
+
/*
* open lock necessary to prevent multiple instances
* of v4l-conf (or other programs) from simultaneously