提交 5942d8ae 编写于 作者: K Kamal Heib 提交者: Doug Ledford

IB/mlx5: Fix memory leak in clean_mr error path

In clean_mr error path the 'mr' should be freed.

Fixes: e126ba97 ('mlx5: Add driver for Mellanox Connect-IB adapters')
Signed-off-by: NKamal Heib <kamalh@mellanox.com>
Signed-off-by: NDoug Ledford <dledford@redhat.com>
上级 ff740aef
......@@ -1490,19 +1490,19 @@ static int clean_mr(struct mlx5_ib_mr *mr)
mlx5_free_priv_descs(mr);
if (!allocated_from_cache) {
u32 key = mr->mmkey.key;
err = destroy_mkey(dev, mr);
kfree(mr);
if (err) {
mlx5_ib_warn(dev, "failed to destroy mkey 0x%x (%d)\n",
mr->mmkey.key, err);
key, err);
return err;
}
} else {
mlx5_mr_cache_free(dev, mr);
}
if (!allocated_from_cache)
kfree(mr);
return 0;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册