V4L/DVB (8750): V4L: check inval in video_register_device_index()
authorHenrik Kretzschmar <henne@nachtwindheim.de>
Wed, 3 Sep 2008 20:11:53 +0000 (17:11 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Wed, 3 Sep 2008 21:37:11 +0000 (18:37 -0300)
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>
drivers/media/video/v4l2-dev.c

index 0320fb84119cf42d25affe9db19bda3eafedc602..155fdec9ac7d7c4fc0aa773581021fbe59ab3355 100644 (file)
@@ -257,6 +257,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;