* [PATCH] V4L: check inval in video_register_device_index()
@ 2008-08-22 19:41 Henne
0 siblings, 0 replies; only message in thread
From: Henne @ 2008-08-22 19:41 UTC (permalink / raw)
To: mchehab; +Cc: video4linux-list, linux-kernel
From: Henrik Kretzschmar <henne@nachtwindheim.de>
Signed-off-by: Henrik Kretzschmar <henne@nachtwindheim.de>
Better check the video_device pointer before using it.
diff --git a/drivers/media/video/v4l2-dev.c b/drivers/media/video/v4l2-dev.c
index 6f36006..ef153ff 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;
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2008-08-22 19:41 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-08-22 19:41 [PATCH] V4L: check inval in video_register_device_index() Henne
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox