summaryrefslogtreecommitdiff
path: root/linux
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@infradead.org>2008-08-22 21:41:03 +0200
committerMauro Carvalho Chehab <mchehab@infradead.org>2008-08-22 21:41:03 +0200
commit2b4a8c362a2f964ce7f6689f4eea3d7552f77e64 (patch)
tree6211888a6593ad3f8c0a2d3f1167b7d00185cfdf /linux
parent4b4308a282febbfa29eb4779f76fc3fd3467e8b3 (diff)
downloadmediapointer-dvb-s2-2b4a8c362a2f964ce7f6689f4eea3d7552f77e64.tar.gz
mediapointer-dvb-s2-2b4a8c362a2f964ce7f6689f4eea3d7552f77e64.tar.bz2
V4L: check inval in video_register_device_index()
From: Henrik Kretzschmar <henne@nachtwindheim.de> Better check the video_device pointer before using it. Signed-off-by: Henrik Kretzschmar <henne@nachtwindheim.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'linux')
-rw-r--r--linux/drivers/media/video/v4l2-dev.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/linux/drivers/media/video/v4l2-dev.c b/linux/drivers/media/video/v4l2-dev.c
index 594f2477f..a3d52e7f7 100644
--- a/linux/drivers/media/video/v4l2-dev.c
+++ b/linux/drivers/media/video/v4l2-dev.c
@@ -292,6 +292,9 @@ int video_register_device_index(struct video_device *vfd, int type, int nr,
int ret;
char *name_base;
+ if (vfd == NULL)
+ return -EINVAL;
+
switch (type) {
case VFL_TYPE_GRABBER:
base = MINOR_VFL_TYPE_GRABBER_MIN;