mlx5: Fix error flow in add_keys
If mlx5_core_create_mkey fails, decrease the pending counter to undo the previous increment. Signed-off-by: Eli Cohen <eli@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
6a4f139aae
commit
d14e71103b
@ -159,6 +159,9 @@ static int add_keys(struct mlx5_ib_dev *dev, int c, int num)
|
||||
sizeof(*in), reg_mr_callback,
|
||||
mr, &mr->out);
|
||||
if (err) {
|
||||
spin_lock_irq(&ent->lock);
|
||||
ent->pending--;
|
||||
spin_unlock_irq(&ent->lock);
|
||||
mlx5_ib_warn(dev, "create mkey failed %d\n", err);
|
||||
kfree(mr);
|
||||
break;
|
||||
|
Loading…
Reference in New Issue
Block a user