summaryrefslogtreecommitdiffstats
path: root/drivers/media/usb/uvc
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2017-10-17 13:15:54 -0400
committerMauro Carvalho Chehab <mchehab@s-opensource.com>2017-12-08 11:33:09 -0500
commit0393e735649dc41358adb7b603bd57dad1ed3260 (patch)
tree57425e4e4c1bf9bbb4a2c7d3d74d06ed6a47d76d /drivers/media/usb/uvc
parentdfc1648c576719b5a2701805aab1e208789d5969 (diff)
downloadlinux-0393e735649dc41358adb7b603bd57dad1ed3260.tar.bz2
media: uvcvideo: Stream error events carry no data
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>
Diffstat (limited to 'drivers/media/usb/uvc')
-rw-r--r--drivers/media/usb/uvc/uvc_status.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/media/usb/uvc/uvc_status.c b/drivers/media/usb/uvc/uvc_status.c
index f552ab997956..1ef20e74b7ac 100644
--- a/drivers/media/usb/uvc/uvc_status.c
+++ b/drivers/media/usb/uvc/uvc_status.c
@@ -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);
}
}