From: Henrik Kretzschmar Date: Wed, 3 Sep 2008 20:11:53 +0000 (-0300) Subject: V4L/DVB (8750): V4L: check inval in video_register_device_index() X-Git-Tag: v2.6.27-rc6~37^2~4^2~46 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=f3b9f50ef771670b5d94c568241d6766691c6c18;p=linux-2.6-omap-h63xx.git 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 Signed-off-by: Mauro Carvalho Chehab --- diff --git a/drivers/media/video/v4l2-dev.c b/drivers/media/video/v4l2-dev.c index 0320fb84119..155fdec9ac7 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, int ret; char *name_base; + if (vfd == NULL) + return -EINVAL; + switch (type) { case VFL_TYPE_GRABBER: base = MINOR_VFL_TYPE_GRABBER_MIN;