media: uvcvideo: Stream error events carry no data
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Tue, 17 Oct 2017 17:15:54 +0000 (13:15 -0400)
committerMauro Carvalho Chehab <mchehab@s-opensource.com>
Fri, 8 Dec 2017 16:33:09 +0000 (11:33 -0500)
According to the UVC specification, stream error events carry no data.
Fix a buffer overflow (that should be harmless given data alignment)
when reporting the stream error event by removing the data byte from the
message.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
drivers/media/usb/uvc/uvc_status.c

index f552ab9..1ef20e7 100644 (file)
@@ -93,8 +93,9 @@ static void uvc_event_streaming(struct uvc_device *dev, __u8 *data, int len)
                        data[1], data[3] ? "pressed" : "released", len);
                uvc_input_report_key(dev, KEY_CAMERA, data[3]);
        } else {
-               uvc_trace(UVC_TRACE_STATUS, "Stream %u error event %02x %02x "
-                       "len %d.\n", data[1], data[2], data[3], len);
+               uvc_trace(UVC_TRACE_STATUS,
+                         "Stream %u error event %02x len %d.\n",
+                         data[1], data[2], len);
        }
 }