* [PATCH v2] Staging: unisys: visornic: Use kcalloc instead of kzalloc.
@ 2015-08-06 11:25 Shraddha Barke
0 siblings, 0 replies; only message in thread
From: Shraddha Barke @ 2015-08-06 11:25 UTC (permalink / raw)
To: Benjamin Romer, David Kershner, Greg Kroah-Hartman, Neil Horman,
Tim Sell, sparmaintainer, linux-kernel
Cc: Shraddha Barke
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(-)
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;
--
2.1.0
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2015-08-06 11:25 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-08-06 11:25 [PATCH v2] Staging: unisys: visornic: Use kcalloc instead of kzalloc Shraddha Barke
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®