Skip to contentSkip to conversation

V4L: check inval in video_register_device_index()

PATCH New Henne 1 participant 1 message Aug 22, 2008 Media (V4L/DVB)

lore
Share & tools
lore

Henne

author
#0 lore raw

PATCH 1/1 V4L: check inval in video_register_device_index()

From: Henrik Kretzschmar <[email protected]>

Better check the video_device pointer before using it.

drivers/media/video/v4l2-dev.c +0 -0
index 6f36006..ef153ff 100644
@@ -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;