aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/unisys/visornic
diff options
context:
space:
mode:
authorShraddha Barke <shraddha.6596@gmail.com>2015-10-09 21:03:28 +0530
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2015-10-12 20:49:29 -0700
commit5e757bc58d15b9fc7d36bb4fcc6f068489e2d29d (patch)
tree2f2d8f5ec75e882dab8ebb1bc4d3fc99fa66791a /drivers/staging/unisys/visornic
parentstaging: rtl8188eu: spaces preferred around that + inserted (diff)
downloadlinux-dev-5e757bc58d15b9fc7d36bb4fcc6f068489e2d29d.tar.xz
linux-dev-5e757bc58d15b9fc7d36bb4fcc6f068489e2d29d.zip
Staging: unisys: Use kcalloc instead of kzalloc to allocate array
The advantage of kcalloc is, that will prevent integer overflows which could result from the multiplication of number of elements and size and it is also a bit nicer to read. Signed-off-by: Shraddha Barke <shraddha.6596@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/unisys/visornic')
-rw-r--r--drivers/staging/unisys/visornic/visornic_main.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/staging/unisys/visornic/visornic_main.c b/drivers/staging/unisys/visornic/visornic_main.c
index 85c9fec6549e..6db74ded184c 100644
--- a/drivers/staging/unisys/visornic/visornic_main.c
+++ b/drivers/staging/unisys/visornic/visornic_main.c
@@ -1797,8 +1797,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;