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>
This commit is contained in:
Laurent Pinchart 2017-10-17 13:15:54 -04:00 committed by Mauro Carvalho Chehab
parent dfc1648c57
commit 0393e73564
1 changed files with 3 additions and 2 deletions

View 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);
}
}