[ofa-general] [PATCH] mlx4: fix double-kfree in mlx4_mr_alloc error flow
Jack Morgenstein
jackm at dev.mellanox.co.il
Thu Jul 26 01:16:58 PDT 2007
Eliminate double-kfree in mlx4_mr_alloc error flow.
Signed-off-by: Jack Morgenstein <jackm at dev.mellanox.co.il>
Index: connectx/drivers/net/mlx4/mr.c
===================================================================
--- connectx.orig/drivers/net/mlx4/mr.c 2007-07-26 10:04:57.000000000 +0300
+++ connectx/drivers/net/mlx4/mr.c 2007-07-26 10:08:14.070595000 +0300
@@ -255,10 +255,8 @@ int mlx4_mr_alloc(struct mlx4_dev *dev,
int err;
index = mlx4_bitmap_alloc(&priv->mr_table.mpt_bitmap);
- if (index == -1) {
- err = -ENOMEM;
- goto err;
- }
+ if (index == -1)
+ return -ENOMEM;
mr->iova = iova;
mr->size = size;
@@ -275,9 +273,6 @@ int mlx4_mr_alloc(struct mlx4_dev *dev,
err_index:
mlx4_bitmap_free(&priv->mr_table.mpt_bitmap, index);
-
-err:
- kfree(mr);
return err;
}
EXPORT_SYMBOL_GPL(mlx4_mr_alloc);
More information about the general
mailing list