summaryrefslogtreecommitdiff
path: root/drivers/staging/rtl8192e
diff options
context:
space:
mode:
authorShraddha Barke <shraddha.6596@gmail.com>2015-10-09 15:33:29 (GMT)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2015-10-13 03:54:14 (GMT)
commit749f3c05004ea9bf5b8cfca2c9edd41c764d68c2 (patch)
treeffb2bc60054c4865622d7608a94afc7515439ac4 /drivers/staging/rtl8192e
parent41cb5786550ef67f970a2c1446f480d1ee0e2b69 (diff)
downloadlinux-749f3c05004ea9bf5b8cfca2c9edd41c764d68c2.tar.xz
Staging: rtl8192e: 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/rtl8192e')
-rw-r--r--drivers/staging/rtl8192e/rtllib_module.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/staging/rtl8192e/rtllib_module.c b/drivers/staging/rtl8192e/rtllib_module.c
index a0d5546..113fbf7 100644
--- a/drivers/staging/rtl8192e/rtllib_module.c
+++ b/drivers/staging/rtl8192e/rtllib_module.c
@@ -59,9 +59,8 @@ static inline int rtllib_networks_allocate(struct rtllib_device *ieee)
if (ieee->networks)
return 0;
- ieee->networks = kzalloc(
- MAX_NETWORK_COUNT * sizeof(struct rtllib_network),
- GFP_KERNEL);
+ ieee->networks = kcalloc(MAX_NETWORK_COUNT,
+ sizeof(struct rtllib_network), GFP_KERNEL);
if (!ieee->networks)
return -ENOMEM;