summaryrefslogtreecommitdiff
path: root/drivers/media
diff options
context:
space:
mode:
authorMarkus Elfring <elfring@users.sourceforge.net>2016-10-07 22:07:43 +0300
committerMauro Carvalho Chehab <mchehab@s-opensource.com>2016-11-16 17:16:20 +0300
commitd2dc12d6c8325d1093ffb142315f6b4fc53f95e7 (patch)
tree97f86c22a2945897046833e45cd409c174cbb6ab /drivers/media
parentbd676c0c04ec94bd830b9192e2c33f2c4532278d (diff)
downloadlinux-d2dc12d6c8325d1093ffb142315f6b4fc53f95e7.tar.xz
[media] dvb-tc90522: Use kmalloc_array() in tc90522_master_xfer()
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 <elfring@users.sourceforge.net> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Diffstat (limited to 'drivers/media')
-rw-r--r--drivers/media/dvb-frontends/tc90522.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/media/dvb-frontends/tc90522.c b/drivers/media/dvb-frontends/tc90522.c
index 31cd32532387..c2d45f071331 100644
--- a/drivers/media/dvb-frontends/tc90522.c
+++ b/drivers/media/dvb-frontends/tc90522.c
@@ -656,7 +656,7 @@ tc90522_master_xfer(struct i2c_adapter *adap, struct i2c_msg *msgs, int num)
for (i = 0; i < num; i++)
if (msgs[i].flags & I2C_M_RD)
rd_num++;
- new_msgs = kmalloc(sizeof(*new_msgs) * (num + rd_num), GFP_KERNEL);
+ new_msgs = kmalloc_array(num + rd_num, sizeof(*new_msgs), GFP_KERNEL);
if (!new_msgs)
return -ENOMEM;