summaryrefslogtreecommitdiff
path: root/drivers/staging/vt6656/iwctl.c
diff options
context:
space:
mode:
authorIulia Manda <iulia.manda21@gmail.com>2014-03-08 18:05:36 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-03-08 20:31:53 -0800
commit879ea7d34e7d15a1aa6a1fe375b307ab02c37808 (patch)
treeac7a0cd15c0fc6ae98f31888dff8a5aece2f3931 /drivers/staging/vt6656/iwctl.c
parent0481dccb89995bc052597cce62696e90a0978081 (diff)
Staging:vt6656: Replace some kzalloc calls with kcalloc in iwctl.c
This replacement is justified by the fact that kcalloc could prevent integer overflow resulted from the multiplications used in kzalloc. The semantic patch that showed this suggestion is kzalloc.cocci Signed-off-by: Iulia Manda <iulia.manda21@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/vt6656/iwctl.c')
-rw-r--r--drivers/staging/vt6656/iwctl.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/staging/vt6656/iwctl.c b/drivers/staging/vt6656/iwctl.c
index 60264a655f24..bedc8104e835 100644
--- a/drivers/staging/vt6656/iwctl.c
+++ b/drivers/staging/vt6656/iwctl.c
@@ -725,10 +725,10 @@ int iwctl_giwaplist(struct net_device *dev, struct iw_request_info *info,
if (!wrq->pointer)
return -EINVAL;
- sock = kzalloc(sizeof(struct sockaddr) * IW_MAX_AP, GFP_KERNEL);
+ sock = kcalloc(IW_MAX_AP, sizeof(struct sockaddr), GFP_KERNEL);
if (sock == NULL)
return -ENOMEM;
- qual = kzalloc(sizeof(struct iw_quality) * IW_MAX_AP, GFP_KERNEL);
+ qual = kcalloc(IW_MAX_AP, sizeof(struct iw_quality), GFP_KERNEL);
if (qual == NULL) {
kfree(sock);
return -ENOMEM;