summaryrefslogtreecommitdiffstats
path: root/drivers/media/dvb-frontends
diff options
context:
space:
mode:
authorMarkus Elfring <elfring@users.sourceforge.net>2016-10-07 16:07:43 -0300
committerMauro Carvalho Chehab <mchehab@s-opensource.com>2016-11-16 12:16:20 -0200
commitd2dc12d6c8325d1093ffb142315f6b4fc53f95e7 (patch)
tree97f86c22a2945897046833e45cd409c174cbb6ab /drivers/media/dvb-frontends
parentbd676c0c04ec94bd830b9192e2c33f2c4532278d (diff)
downloadlinux-stable-d2dc12d6c8325d1093ffb142315f6b4fc53f95e7.tar.gz
linux-stable-d2dc12d6c8325d1093ffb142315f6b4fc53f95e7.tar.bz2
linux-stable-d2dc12d6c8325d1093ffb142315f6b4fc53f95e7.zip
[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/dvb-frontends')
-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;