media: igorplugusb: use correct size pass to igorplugusb_probe()
authorYang Yingliang <yangyingliang@huawei.com>
Tue, 28 Jun 2022 06:54:53 +0000 (07:54 +0100)
committerMauro Carvalho Chehab <mchehab@kernel.org>
Fri, 15 Jul 2022 13:52:20 +0000 (14:52 +0100)
After 'buf_in' change to pointer, the sizeof() is not correct buffer
size, it should be MAX_PACKET.

Fixes: b3f820b905c9 ("media: igorplugusb: respect DMA coherency")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
drivers/media/rc/igorplugusb.c

index 12ee5dd..1464ef9 100644 (file)
@@ -170,7 +170,7 @@ static int igorplugusb_probe(struct usb_interface *intf,
 
        ir->request.bRequest = GET_INFRACODE;
        ir->request.bRequestType = USB_TYPE_VENDOR | USB_DIR_IN;
-       ir->request.wLength = cpu_to_le16(sizeof(ir->buf_in));
+       ir->request.wLength = cpu_to_le16(MAX_PACKET);
 
        ir->urb = usb_alloc_urb(0, GFP_KERNEL);
        if (!ir->urb)
@@ -181,7 +181,7 @@ static int igorplugusb_probe(struct usb_interface *intf,
                goto fail;
        usb_fill_control_urb(ir->urb, udev,
                usb_rcvctrlpipe(udev, 0), (uint8_t *)&ir->request,
-               ir->buf_in, sizeof(ir->buf_in), igorplugusb_callback, ir);
+               ir->buf_in, MAX_PACKET, igorplugusb_callback, ir);
 
        usb_make_path(udev, ir->phys, sizeof(ir->phys));