aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/hw
diff options
context:
space:
mode:
authorEli Cohen <eli@dev.mellanox.co.il>2014-12-02 05:26:19 -0500
committerDavid S. Miller <davem@davemloft.net>2014-12-08 20:45:56 -0500
commitd14e71103bf61ed6c3de542f1752b6ce039b773d (patch)
tree3aa3b7ea8310c18928cd40c6a8782911b3c8b743 /drivers/infiniband/hw
parent6a4f139aae77d601bd146a6b3c4e12e7e4e0226f (diff)
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>
Diffstat (limited to 'drivers/infiniband/hw')
-rw-r--r--drivers/infiniband/hw/mlx5/mr.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/infiniband/hw/mlx5/mr.c b/drivers/infiniband/hw/mlx5/mr.c
index 4c89b64aa9cf..5a80dd993761 100644
--- a/drivers/infiniband/hw/mlx5/mr.c
+++ b/drivers/infiniband/hw/mlx5/mr.c
@@ -159,6 +159,9 @@ static int add_keys(struct mlx5_ib_dev *dev, int c, int num)
159 sizeof(*in), reg_mr_callback, 159 sizeof(*in), reg_mr_callback,
160 mr, &mr->out); 160 mr, &mr->out);
161 if (err) { 161 if (err) {
162 spin_lock_irq(&ent->lock);
163 ent->pending--;
164 spin_unlock_irq(&ent->lock);
162 mlx5_ib_warn(dev, "create mkey failed %d\n", err); 165 mlx5_ib_warn(dev, "create mkey failed %d\n", err);
163 kfree(mr); 166 kfree(mr);
164 break; 167 break;