From: Henrik Kretzschmar Date: Fri, 22 Aug 2008 19:41:03 +0000 (-0300) Subject: V4L/DVB (8750): V4L: check inval in video_register_device_index() X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=ee7aa9f821b27674f36fc09413914b68f7ad97ca;p=linux-beck.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 6b9f3cb0de98..8903e41628eb 100644 --- a/drivers/media/video/v4l2-dev.c +++ b/drivers/media/video/v4l2-dev.c @@ -254,6 +254,9 @@ int video_register_device_index(struct video_device *vfd, int type, int nr, int ret; char *name_base; + if (vfd == NULL) + return -EINVAL; + if (vfd == NULL) return -EINVAL;