projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
b9245d8
)
V4L/DVB: s2255drv: return if vdev not found
author
Dan Carpenter
<
[email protected]
>
Wed, 5 May 2010 06:01:30 +0000
(
03:01
-0300)
committer
Mauro Carvalho Chehab
<
[email protected]
>
Wed, 19 May 2010 15:59:14 +0000
(12:59 -0300)
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 <
[email protected]
>
Cc:
[email protected]
Signed-off-by: Mauro Carvalho Chehab <
[email protected]
>
drivers/media/video/s2255drv.c
patch
|
blob
|
history
diff --git
a/drivers/media/video/s2255drv.c
b/drivers/media/video/s2255drv.c
index ac9c40cf5835f78c597eb52e64d06273d3fee3fb..1f9a49e054a83a050845984d7e213a232d6cbce3 100644
(file)
--- 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