diff options
author | Dan Carpenter <error27@gmail.com> | 2010-05-05 02:01:30 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2010-05-19 11:59:14 -0400 |
commit | aab9796f5580a988c46c130a727cdc398a05317b (patch) | |
tree | dc03abc84addf0ba87bb1da79ac4842ea4c9cefc /drivers/media/video/s2255drv.c | |
parent | b9245d80c375b93db79475ca231276e1fa5a7649 (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/video/s2255drv.c')
-rw-r--r-- | drivers/media/video/s2255drv.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/media/video/s2255drv.c b/drivers/media/video/s2255drv.c index ac9c40cf5835..1f9a49e054a8 100644 --- a/drivers/media/video/s2255drv.c +++ b/drivers/media/video/s2255drv.c | |||
@@ -1716,11 +1716,15 @@ static int s2255_open(struct file *file) | |||
1716 | dprintk(1, "s2255: open called (dev=%s)\n", | 1716 | dprintk(1, "s2255: open called (dev=%s)\n", |
1717 | video_device_node_name(vdev)); | 1717 | video_device_node_name(vdev)); |
1718 | 1718 | ||
1719 | for (i = 0; i < MAX_CHANNELS; i++) | 1719 | for (i = 0; i < MAX_CHANNELS; i++) { |
1720 | if (&dev->vdev[i] == vdev) { | 1720 | if (&dev->vdev[i] == vdev) { |
1721 | cur_channel = i; | 1721 | cur_channel = i; |
1722 | break; | 1722 | break; |
1723 | } | 1723 | } |
1724 | } | ||
1725 | if (i == MAX_CHANNELS) | ||
1726 | return -ENODEV; | ||
1727 | |||
1724 | /* | 1728 | /* |
1725 | * open lock necessary to prevent multiple instances | 1729 | * open lock necessary to prevent multiple instances |
1726 | * of v4l-conf (or other programs) from simultaneously | 1730 | * of v4l-conf (or other programs) from simultaneously |