summaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/mellanox/mlx4/icm.c
diff options
context:
space:
mode:
authorDotan Barak <dotanb@dev.mellanox.co.il>2012-07-11 15:39:32 +0000
committerRoland Dreier <roland@purestorage.com>2012-07-11 09:22:58 -0700
commit240a9207aae24916dba7070aa7047c3732102cb8 (patch)
tree5336564c4329ac44ed1271027dcf0c21a467c822 /drivers/net/ethernet/mellanox/mlx4/icm.c
parent87d4abda83a125dec65181a6ecce3035db76d46a (diff)
downloadtalos-op-linux-240a9207aae24916dba7070aa7047c3732102cb8.tar.gz
talos-op-linux-240a9207aae24916dba7070aa7047c3732102cb8.zip
net/mlx4_core: Free ICM table in case of error
In mlx4_init_icm_table(), free the allocated table if we failed to allocate memory to its entries. Signed-off-by: Dotan Barak <dotanb@dev.mellanox.co.il> Reviewed-by: Yevgeny Petrilin <yevgenyp@mellanox.co.il> Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com> Signed-off-by: Roland Dreier <roland@purestorage.com>
Diffstat (limited to 'drivers/net/ethernet/mellanox/mlx4/icm.c')
-rw-r--r--drivers/net/ethernet/mellanox/mlx4/icm.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/net/ethernet/mellanox/mlx4/icm.c b/drivers/net/ethernet/mellanox/mlx4/icm.c
index a9ade1c3cad5..88b7b3e75ab1 100644
--- a/drivers/net/ethernet/mellanox/mlx4/icm.c
+++ b/drivers/net/ethernet/mellanox/mlx4/icm.c
@@ -413,6 +413,8 @@ err:
mlx4_free_icm(dev, table->icm[i], use_coherent);
}
+ kfree(table->icm);
+
return -ENOMEM;
}
OpenPOWER on IntegriCloud