]> git.baikalelectronics.ru Git - kernel.git/commit
media: stk1160: fix number of buffers in case not all buffers are created
authorDafna Hirschfeld <dafna.hirschfeld@collabora.com>
Tue, 25 Jan 2022 08:02:10 +0000 (09:02 +0100)
committerMauro Carvalho Chehab <mchehab@kernel.org>
Mon, 7 Mar 2022 09:58:12 +0000 (10:58 +0100)
commita8fa6f5c8d511c2ce78106a617dd180818fb7811
treeace46da63a254fc337a7c7a4060abb98b353fc1e
parent409dfdcf1f5d027e017b79bf8cf7d2a958a14546
media: stk1160: fix number of buffers in case not all buffers are created

In case we fail to allocate a transfer_buffer then we
break the buffers creation loop and update the number of
buffers to the number of successfully allocated which should
be 'i' and not 'i - 1' nor 'i + 1'

Signed-off-by: Dafna Hirschfeld <dafna.hirschfeld@collabora.com>
Reviewed-by: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
drivers/media/usb/stk1160/stk1160-video.c