summaryrefslogtreecommitdiffstats
path: root/drivers/media/usb/tm6000
diff options
context:
space:
mode:
authorColin Ian King <colin.king@canonical.com>2020-10-08 23:12:23 +0200
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>2020-11-16 10:31:09 +0100
commita08ad6339e0441ca12533969ed94a87e3655426e (patch)
treef8713194601742b578a503cb325dba52660950d9 /drivers/media/usb/tm6000
parente5c0cd26d54e2e52792de2be3c32c9627168a06e (diff)
downloadlinux-stable-a08ad6339e0441ca12533969ed94a87e3655426e.tar.gz
linux-stable-a08ad6339e0441ca12533969ed94a87e3655426e.tar.bz2
linux-stable-a08ad6339e0441ca12533969ed94a87e3655426e.zip
media: tm6000: Fix sizeof() mismatches
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>
Diffstat (limited to 'drivers/media/usb/tm6000')
-rw-r--r--drivers/media/usb/tm6000/tm6000-video.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/media/usb/tm6000/tm6000-video.c b/drivers/media/usb/tm6000/tm6000-video.c
index bfba06ea60e9..2df736c029d6 100644
--- a/drivers/media/usb/tm6000/tm6000-video.c
+++ b/drivers/media/usb/tm6000/tm6000-video.c
@@ -461,11 +461,12 @@ static int tm6000_alloc_urb_buffers(struct tm6000_core *dev)
if (dev->urb_buffer)
return 0;
- dev->urb_buffer = kmalloc_array(num_bufs, sizeof(void *), GFP_KERNEL);
+ dev->urb_buffer = kmalloc_array(num_bufs, sizeof(*dev->urb_buffer),
+ GFP_KERNEL);
if (!dev->urb_buffer)
return -ENOMEM;
- dev->urb_dma = kmalloc_array(num_bufs, sizeof(dma_addr_t *),
+ dev->urb_dma = kmalloc_array(num_bufs, sizeof(*dev->urb_dma),
GFP_KERNEL);
if (!dev->urb_dma)
return -ENOMEM;