Skip to content

Commit

Permalink
V4L/DVB: s2255drv: return if vdev not found
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Dan Carpenter authored and Mauro Carvalho Chehab committed May 19, 2010
1 parent b9245d8 commit aab9796
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion drivers/media/video/s2255drv.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit aab9796

Please sign in to comment.