diff options
author | Joe Perches <joe@perches.com> | 2010-08-11 03:02:48 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-08-17 20:45:14 -0400 |
commit | baeb2ffab4e67bb9174e6166e070a9a8ec94b0f6 (patch) | |
tree | 08259e966cc0cacc58ed58a4865fe861cc255241 /drivers/net/cnic.c | |
parent | 5a68d5ee000bb784c4856391b4861739c8bbd341 (diff) |
drivers/net: Convert unbounded kzalloc calls to kcalloc
These changes may be slightly safer in some instances.
There are other kzalloc calls with a multiply, but those
calls are typically "small fixed #" * sizeof(some pointer)"
and those are not converted.
Signed-off-by: Joe Perches <joe@perches.com>
Acked-by: Gertjan van Wingerde <gwingerde@gmail.com>
Acked-by: Luciano Coelho <luciano.coelho@nokia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/cnic.c')
-rw-r--r-- | drivers/net/cnic.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/cnic.c b/drivers/net/cnic.c index 09610323a948..2ab6a7c4ffc1 100644 --- a/drivers/net/cnic.c +++ b/drivers/net/cnic.c | |||
@@ -1022,7 +1022,7 @@ static int cnic_alloc_bnx2x_context(struct cnic_dev *dev) | |||
1022 | if (blks > cp->ethdev->ctx_tbl_len) | 1022 | if (blks > cp->ethdev->ctx_tbl_len) |
1023 | return -ENOMEM; | 1023 | return -ENOMEM; |
1024 | 1024 | ||
1025 | cp->ctx_arr = kzalloc(blks * sizeof(struct cnic_ctx), GFP_KERNEL); | 1025 | cp->ctx_arr = kcalloc(blks, sizeof(struct cnic_ctx), GFP_KERNEL); |
1026 | if (cp->ctx_arr == NULL) | 1026 | if (cp->ctx_arr == NULL) |
1027 | return -ENOMEM; | 1027 | return -ENOMEM; |
1028 | 1028 | ||