Skip to content

Commit

Permalink
net/mlx4_core: Free ICM table in case of error
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Dotan Barak authored and Roland Dreier committed Jul 11, 2012
1 parent 87d4abd commit 240a920
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/net/ethernet/mellanox/mlx4/icm.c
Original file line number Diff line number Diff line change
Expand Up @@ -413,6 +413,8 @@ int mlx4_init_icm_table(struct mlx4_dev *dev, struct mlx4_icm_table *table,
mlx4_free_icm(dev, table->icm[i], use_coherent);
}

kfree(table->icm);

return -ENOMEM;
}

Expand Down

0 comments on commit 240a920

Please sign in to comment.