Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

media: stk1160: Restore deleted comment in stk1160_fill_urb()

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>

authored by

Dan Carpenter and committed by
Hans Verkuil
6704c672 419f151d

+6 -1
+6 -1
drivers/media/usb/stk1160/stk1160-video.c
··· 408 408 stk_urb->transfer_buffer = usb_alloc_noncoherent(dev->udev, sb_size, 409 409 GFP_KERNEL, &stk_urb->dma, 410 410 DMA_FROM_DEVICE, &stk_urb->sgt); 411 - if (!stk_urb->transfer_buffer) 411 + if (!stk_urb->transfer_buffer) { 412 + /* 413 + * If the buffer allocation failed, we exit but return 0 since 414 + * we allow the driver working with less buffers. 415 + */ 412 416 goto free_urb; 417 + } 413 418 414 419 stk_urb->dev = dev; 415 420 return 0;