Skip to content

Commit

Permalink
mlx4_core: Avoid double free_icms
Browse files Browse the repository at this point in the history
On the error path of mlx4_init_hca(), mlx4_close_hca() is called,
followed by mlx4_free_icms() and mlx4_UNMAP_FA().  But both those
functions are also called from mlx4_close_hca(), which leads to a
double free.

Signed-off-by: Yevgeny Petrilin <yevgenyp@mellanox.co.il>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
  • Loading branch information
Yevgeny Petrilin authored and Roland Dreier committed Sep 6, 2009
1 parent fa0681d commit 1af92e2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/net/mlx4/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -789,7 +789,7 @@ static int mlx4_init_hca(struct mlx4_dev *dev)
return 0;

err_close:
mlx4_close_hca(dev);
mlx4_CLOSE_HCA(dev, 0);

err_free_icm:
mlx4_free_icms(dev);
Expand Down

0 comments on commit 1af92e2

Please sign in to comment.