treewide: kmalloc() -> kmalloc_array()
[linux-block.git] / net / can / bcm.c
index 97fedff3f0c4f56bea5f04d1708c59608ab87982..394ff1d2791f1e3947a4ed0c8953f9d9b227b35a 100644 (file)
@@ -923,8 +923,9 @@ static int bcm_tx_setup(struct bcm_msg_head *msg_head, struct msghdr *msg,
 
                /* create array for CAN frames and copy the data */
                if (msg_head->nframes > 1) {
-                       op->frames = kmalloc(msg_head->nframes * op->cfsiz,
-                                            GFP_KERNEL);
+                       op->frames = kmalloc_array(msg_head->nframes,
+                                                  op->cfsiz,
+                                                  GFP_KERNEL);
                        if (!op->frames) {
                                kfree(op);
                                return -ENOMEM;
@@ -1095,8 +1096,9 @@ static int bcm_rx_setup(struct bcm_msg_head *msg_head, struct msghdr *msg,
 
                if (msg_head->nframes > 1) {
                        /* create array for CAN frames and copy the data */
-                       op->frames = kmalloc(msg_head->nframes * op->cfsiz,
-                                            GFP_KERNEL);
+                       op->frames = kmalloc_array(msg_head->nframes,
+                                                  op->cfsiz,
+                                                  GFP_KERNEL);
                        if (!op->frames) {
                                kfree(op);
                                return -ENOMEM;