From: Markus Elfring Date: Fri, 14 Oct 2016 05:19:00 +0000 (-0300) Subject: [media] winbond-cir: Use kmalloc_array() in wbcir_tx() X-Git-Tag: v4.10-rc1~71^2^2~148 X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=commitdiff_plain;h=ce3aeaf22c9f6d9dbbad00600b26ddd0263f8cbc;p=linux.git [media] winbond-cir: Use kmalloc_array() in wbcir_tx() A multiplication for the size determination of a memory allocation indicated that an array data structure should be processed. Thus use the corresponding function "kmalloc_array". This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring Signed-off-by: David Härdeman Signed-off-by: Mauro Carvalho Chehab --- diff --git a/drivers/media/rc/winbond-cir.c b/drivers/media/rc/winbond-cir.c index cdcd6e38b295..8c1f9225d358 100644 --- a/drivers/media/rc/winbond-cir.c +++ b/drivers/media/rc/winbond-cir.c @@ -658,7 +658,7 @@ wbcir_tx(struct rc_dev *dev, unsigned *b, unsigned count) unsigned i; unsigned long flags; - buf = kmalloc(count * sizeof(*b), GFP_KERNEL); + buf = kmalloc_array(count, sizeof(*b), GFP_KERNEL); if (!buf) return -ENOMEM;