]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
media: tm6000: Fix sizeof() mismatches
authorColin Ian King <colin.king@canonical.com>
Thu, 8 Oct 2020 21:12:23 +0000 (23:12 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 30 Dec 2020 10:25:53 +0000 (11:25 +0100)
commit390b4d5a38e46fc3abbaf6ca66ef3f2db9de7284
tree0f3cfc0f4eb42ea30f20f398f783fa1f544416d3
parentd5f225ccabb49141dc0030a43b002d78a93045b5
media: tm6000: Fix sizeof() mismatches

[ Upstream commit a08ad6339e0441ca12533969ed94a87e3655426e ]

The are two instances of sizeof() being used incorrectly. The
sizeof(void *) is incorrect because urb_buffer is a char ** pointer,
fix this by using sizeof(*dev->urb_buffer).  The sizeof(dma_addr_t *)
is incorrect, it should be sizeof(*dev->urb_dma), which is a dma_addr_t
and not a dma_addr_t *.  This errors did not cause any issues because
it just so happens the sizes are the same.

Addresses-Coverity: ("Sizeof not portable (SIZEOF_MISMATCH)")

Fixes: 16427faf2867 ("[media] tm6000: Add parameter to keep urb bufs allocated")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/media/usb/tm6000/tm6000-video.c