Skip to content

Commit

Permalink
IB/mlx4: Remove unneeded NULL check
Browse files Browse the repository at this point in the history
NULL check for kfree is unnecessary, remove it.

Fixes: b42dde4 ("IB/mlx4: Rework special QP creation error path")
Signed-off-by: Yuval Shaia <yuval.shaia@oracle.com>
Reviewed-by: Leon Romanovsky <leonro@mellanox.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
  • Loading branch information
Yuval Shaia authored and Jason Gunthorpe committed Dec 11, 2018
1 parent 8cc0698 commit 2dd8e44
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions drivers/infiniband/hw/mlx4/qp.c
Original file line number Diff line number Diff line change
Expand Up @@ -1211,10 +1211,10 @@ static int create_qp_common(struct mlx4_ib_dev *dev, struct ib_pd *pd,
mlx4_db_free(dev->dev, &qp->db);

err:
if (sqp)
kfree(sqp);
else if (!*caller_qp)
if (!sqp && !*caller_qp)
kfree(qp);
kfree(sqp);

return err;
}

Expand Down

0 comments on commit 2dd8e44

Please sign in to comment.