mlx5ib: Fix memory leak in clean_mr() error path
In the clean_mr() error path the 'mr' should be freed. Linux commit: 5942d8ae411775b76e5e1ab0cce57b0666516f2d PR: 264653 MFC after: 1 week Sponsored by: NVIDIA Networking
This commit is contained in:
parent
6468cd8e0e
commit
e4d178d093
@ -1285,10 +1285,13 @@ static int clean_mr(struct mlx5_ib_mr *mr)
|
||||
mlx5_free_priv_descs(mr);
|
||||
|
||||
if (!umred) {
|
||||
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 {
|
||||
@ -1300,9 +1303,6 @@ static int clean_mr(struct mlx5_ib_mr *mr)
|
||||
free_cached_mr(dev, mr);
|
||||
}
|
||||
|
||||
if (!umred)
|
||||
kfree(mr);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user