V4L/DVB (13504): uvcvideo: Fix extension units parsing
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Wed, 25 Nov 2009 15:00:27 +0000 (12:00 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Sat, 5 Dec 2009 20:42:12 +0000 (18:42 -0200)
The bNrInPins field is an 8 bit integer, not a 16 bit integer.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/video/uvc/uvc_driver.c

index db28311d6ec8e011451fa017232788bb3600b503..8d51a6a130b0417feedd74a2a62a5e4f845c3af9 100644 (file)
@@ -844,7 +844,7 @@ static int uvc_parse_vendor_control(struct uvc_device *dev,
                unit->type = UVC_VC_EXTENSION_UNIT;
                memcpy(unit->extension.guidExtensionCode, &buffer[4], 16);
                unit->extension.bNumControls = buffer[20];
-               unit->extension.bNrInPins = get_unaligned_le16(&buffer[21]);
+               unit->extension.bNrInPins = buffer[21];
                unit->extension.baSourceID = (__u8 *)unit + sizeof *unit;
                memcpy(unit->extension.baSourceID, &buffer[22], p);
                unit->extension.bControlSize = buffer[22+p];
@@ -1108,7 +1108,7 @@ static int uvc_parse_standard_control(struct uvc_device *dev,
                unit->type = buffer[2];
                memcpy(unit->extension.guidExtensionCode, &buffer[4], 16);
                unit->extension.bNumControls = buffer[20];
-               unit->extension.bNrInPins = get_unaligned_le16(&buffer[21]);
+               unit->extension.bNrInPins = buffer[21];
                unit->extension.baSourceID = (__u8 *)unit + sizeof *unit;
                memcpy(unit->extension.baSourceID, &buffer[22], p);
                unit->extension.bControlSize = buffer[22+p];