[v2] Staging: unisys: visornic: Use kcalloc instead of kzalloc.
diff mbox series

Message ID 1438860341-15248-1-git-send-email-shraddha.6596@gmail.com
State New, archived
Headers show
Series
  • [v2] Staging: unisys: visornic: Use kcalloc instead of kzalloc.
Related show

Commit Message

Shraddha Barke Aug. 6, 2015, 11:25 a.m. UTC
This patch converts kzalloc to kcalloc. The advantage of kcalloc is, 
that will take care of integer overflows which could result from the 
multiplication and it is also nicer to read.

The change was made using Coccinelle.

Signed-off-by: Shraddha Barke <shraddha.6596@gmail.com>
---
Changes in v2;
  -Make commit message clearer.

 drivers/staging/unisys/visornic/visornic_main.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Patch
diff mbox series

diff --git a/drivers/staging/unisys/visornic/visornic_main.c b/drivers/staging/unisys/visornic/visornic_main.c
index 2a9b055..e4a7b9b5 100644
--- a/drivers/staging/unisys/visornic/visornic_main.c
+++ b/drivers/staging/unisys/visornic/visornic_main.c
@@ -1843,8 +1843,8 @@  static int visornic_probe(struct visor_device *dev)
 		goto cleanup_netdev;
 	}
 
-	devdata->rcvbuf = kzalloc(sizeof(struct sk_buff *) *
-				  devdata->num_rcv_bufs, GFP_KERNEL);
+	devdata->rcvbuf = kcalloc(devdata->num_rcv_bufs,
+				  sizeof(struct sk_buff *), GFP_KERNEL);
 	if (!devdata->rcvbuf) {
 		err = -ENOMEM;
 		goto cleanup_rcvbuf;