]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
media: stk1160: Restore deleted comment in stk1160_fill_urb()
authorDan Carpenter <dan.carpenter@linaro.org>
Tue, 15 Jul 2025 23:00:32 +0000 (18:00 -0500)
committerHans Verkuil <hverkuil+cisco@kernel.org>
Fri, 29 Aug 2025 09:04:02 +0000 (11:04 +0200)
This comment explains why we return success when usb_alloc_noncoherent()
fails and I think it's helpful.  It was deleted during a recent refactor,
but let's add it back.

Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Reviewed-by: Xu Yang <xu.yang_2@nxp.com>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
drivers/media/usb/stk1160/stk1160-video.c

index 416cb74377eb1daf1e431bc744b104577a1b4161..f4baf9263286273d6fcececdda849f957f97a2ca 100644 (file)
@@ -408,8 +408,13 @@ static int stk1160_fill_urb(struct stk1160 *dev, struct stk1160_urb *stk_urb,
        stk_urb->transfer_buffer = usb_alloc_noncoherent(dev->udev, sb_size,
                                                         GFP_KERNEL, &stk_urb->dma,
                                                         DMA_FROM_DEVICE, &stk_urb->sgt);
-       if (!stk_urb->transfer_buffer)
+       if (!stk_urb->transfer_buffer) {
+               /*
+                * If the buffer allocation failed, we exit but return 0 since
+                * we allow the driver working with less buffers.
+                */
                goto free_urb;
+       }
 
        stk_urb->dev = dev;
        return 0;