Skip to content

Commit

Permalink
[media] winbond-cir: Use kmalloc_array() in wbcir_tx()
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: David Härdeman <[email protected]>
Signed-off-by: Mauro Carvalho Chehab <[email protected]>
  • Loading branch information
elfring authored and mchehab committed Nov 18, 2016
1 parent 3f81678 commit ce3aeaf
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/media/rc/winbond-cir.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit ce3aeaf

Please sign in to comment.