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/ehea | |
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/ehea')
-rw-r--r-- | drivers/net/ehea/ehea_main.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/net/ehea/ehea_main.c b/drivers/net/ehea/ehea_main.c index 897719b49f96..0f9b27b93a71 100644 --- a/drivers/net/ehea/ehea_main.c +++ b/drivers/net/ehea/ehea_main.c | |||
@@ -180,7 +180,7 @@ static void ehea_update_firmware_handles(void) | |||
180 | num_portres * EHEA_NUM_PORTRES_FW_HANDLES; | 180 | num_portres * EHEA_NUM_PORTRES_FW_HANDLES; |
181 | 181 | ||
182 | if (num_fw_handles) { | 182 | if (num_fw_handles) { |
183 | arr = kzalloc(num_fw_handles * sizeof(*arr), GFP_KERNEL); | 183 | arr = kcalloc(num_fw_handles, sizeof(*arr), GFP_KERNEL); |
184 | if (!arr) | 184 | if (!arr) |
185 | goto out; /* Keep the existing array */ | 185 | goto out; /* Keep the existing array */ |
186 | } else | 186 | } else |
@@ -265,7 +265,7 @@ static void ehea_update_bcmc_registrations(void) | |||
265 | } | 265 | } |
266 | 266 | ||
267 | if (num_registrations) { | 267 | if (num_registrations) { |
268 | arr = kzalloc(num_registrations * sizeof(*arr), GFP_ATOMIC); | 268 | arr = kcalloc(num_registrations, sizeof(*arr), GFP_ATOMIC); |
269 | if (!arr) | 269 | if (!arr) |
270 | goto out; /* Keep the existing array */ | 270 | goto out; /* Keep the existing array */ |
271 | } else | 271 | } else |