]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commitdiff
media: gspca/sq905: fix control-request direction
authorJohan Hovold <johan@kernel.org>
Fri, 21 May 2021 13:28:39 +0000 (15:28 +0200)
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Wed, 2 Jun 2021 12:10:25 +0000 (14:10 +0200)
The direction of the pipe argument must match the request-type direction
bit or control requests may fail depending on the host-controller-driver
implementation.

Fix the USB_REQ_SYNCH_FRAME request which erroneously used
usb_sndctrlpipe().

Fixes: 27d35fc3fb06 ("V4L/DVB (10639): gspca - sq905: New subdriver.")
Cc: stable@vger.kernel.org # 2.6.30
Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
drivers/media/usb/gspca/sq905.c

index 949111070971822fcdeeac6cf33139588c326cac..32504ebcfd4dee6ad0da4f4b0affa3c07bf3fd97 100644 (file)
@@ -116,7 +116,7 @@ static int sq905_command(struct gspca_dev *gspca_dev, u16 index)
        }
 
        ret = usb_control_msg(gspca_dev->dev,
-                             usb_sndctrlpipe(gspca_dev->dev, 0),
+                             usb_rcvctrlpipe(gspca_dev->dev, 0),
                              USB_REQ_SYNCH_FRAME,                /* request */
                              USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
                              SQ905_PING, 0, gspca_dev->usb_buf, 1,