v4l2-ioctl: log buffer type 0 correctly
authorHans Verkuil <hans.verkuil@cisco.com>
Fri, 5 Jun 2015 14:28:51 +0000 (11:28 -0300)
committerSeung-Woo Kim <sw0312.kim@samsung.com>
Wed, 14 Dec 2016 04:49:06 +0000 (13:49 +0900)
If userspace passed the invalid buffer type 0 to the kernel, then the
kernel log would show 'type=(null)' since there was no string defined
for type 0. Fix this.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
drivers/media/v4l2-core/v4l2-ioctl.c

index aa407cb..be99a18 100644 (file)
@@ -142,6 +142,7 @@ const char *v4l2_field_names[] = {
 EXPORT_SYMBOL(v4l2_field_names);
 
 const char *v4l2_type_names[] = {
+       [0]                                = "0",
        [V4L2_BUF_TYPE_VIDEO_CAPTURE]      = "vid-cap",
        [V4L2_BUF_TYPE_VIDEO_OVERLAY]      = "vid-overlay",
        [V4L2_BUF_TYPE_VIDEO_OUTPUT]       = "vid-out",