aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/v4l2-dev.c
diff options
context:
space:
mode:
authorHenrik Kretzschmar <henne@nachtwindheim.de>2008-09-03 16:11:53 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2008-09-03 17:37:11 -0400
commitf3b9f50ef771670b5d94c568241d6766691c6c18 (patch)
tree86fd5e9b33f381d7e3f5a67641958f42d4462fee /drivers/media/video/v4l2-dev.c
parent5b5aff83a549c8f1e425e06d46ec951eae950b37 (diff)
V4L/DVB (8750): V4L: check inval in video_register_device_index()
Better check the video_device pointer before using it. Signed-off-by: Henrik Kretzschmar <henne@nachtwindheim.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/v4l2-dev.c')
-rw-r--r--drivers/media/video/v4l2-dev.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/media/video/v4l2-dev.c b/drivers/media/video/v4l2-dev.c
index 0320fb84119c..155fdec9ac7d 100644
--- a/drivers/media/video/v4l2-dev.c
+++ b/drivers/media/video/v4l2-dev.c
@@ -257,6 +257,9 @@ int video_register_device_index(struct video_device *vfd, int type, int nr,
257 int ret; 257 int ret;
258 char *name_base; 258 char *name_base;
259 259
260 if (vfd == NULL)
261 return -EINVAL;
262
260 switch (type) { 263 switch (type) {
261 case VFL_TYPE_GRABBER: 264 case VFL_TYPE_GRABBER:
262 base = MINOR_VFL_TYPE_GRABBER_MIN; 265 base = MINOR_VFL_TYPE_GRABBER_MIN;