aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/vxge/vxge-main.c
diff options
context:
space:
mode:
authorJoe Perches <joe@perches.com>2010-08-11 03:02:48 -0400
committerDavid S. Miller <davem@davemloft.net>2010-08-17 20:45:14 -0400
commitbaeb2ffab4e67bb9174e6166e070a9a8ec94b0f6 (patch)
tree08259e966cc0cacc58ed58a4865fe861cc255241 /drivers/net/vxge/vxge-main.c
parent5a68d5ee000bb784c4856391b4861739c8bbd341 (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/vxge/vxge-main.c')
-rw-r--r--drivers/net/vxge/vxge-main.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/net/vxge/vxge-main.c b/drivers/net/vxge/vxge-main.c
index c7c5605b3728..f5334b287fdb 100644
--- a/drivers/net/vxge/vxge-main.c
+++ b/drivers/net/vxge/vxge-main.c
@@ -2159,8 +2159,8 @@ start:
2159 /* Alarm MSIX Vectors count */ 2159 /* Alarm MSIX Vectors count */
2160 vdev->intr_cnt++; 2160 vdev->intr_cnt++;
2161 2161
2162 vdev->entries = kzalloc(vdev->intr_cnt * sizeof(struct msix_entry), 2162 vdev->entries = kcalloc(vdev->intr_cnt, sizeof(struct msix_entry),
2163 GFP_KERNEL); 2163 GFP_KERNEL);
2164 if (!vdev->entries) { 2164 if (!vdev->entries) {
2165 vxge_debug_init(VXGE_ERR, 2165 vxge_debug_init(VXGE_ERR,
2166 "%s: memory allocation failed", 2166 "%s: memory allocation failed",
@@ -2169,9 +2169,9 @@ start:
2169 goto alloc_entries_failed; 2169 goto alloc_entries_failed;
2170 } 2170 }
2171 2171
2172 vdev->vxge_entries = 2172 vdev->vxge_entries = kcalloc(vdev->intr_cnt,
2173 kzalloc(vdev->intr_cnt * sizeof(struct vxge_msix_entry), 2173 sizeof(struct vxge_msix_entry),
2174 GFP_KERNEL); 2174 GFP_KERNEL);
2175 if (!vdev->vxge_entries) { 2175 if (!vdev->vxge_entries) {
2176 vxge_debug_init(VXGE_ERR, "%s: memory allocation failed", 2176 vxge_debug_init(VXGE_ERR, "%s: memory allocation failed",
2177 VXGE_DRIVER_NAME); 2177 VXGE_DRIVER_NAME);