Re: [PATCH] IB/ocrdma_hw: remove unnecessary code in ocrdma_mbx_dealloc_lkey

From: Yuval Shaia
Date: Tue Nov 07 2017 - 01:32:03 EST


On Mon, Nov 06, 2017 at 08:35:14AM -0600, Gustavo A. R. Silva wrote:
> Check on return value and goto label mbx_err are unnecessary.
>
> Addresses-Coverity-ID: 1268780

What's that?

> Signed-off-by: Gustavo A. R. Silva <garsilva@xxxxxxxxxxxxxx>
> ---
> drivers/infiniband/hw/ocrdma/ocrdma_hw.c | 4 +---
> 1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/drivers/infiniband/hw/ocrdma/ocrdma_hw.c b/drivers/infiniband/hw/ocrdma/ocrdma_hw.c
> index f8c14c7..db02bbb 100644
> --- a/drivers/infiniband/hw/ocrdma/ocrdma_hw.c
> +++ b/drivers/infiniband/hw/ocrdma/ocrdma_hw.c
> @@ -1956,9 +1956,7 @@ int ocrdma_mbx_dealloc_lkey(struct ocrdma_dev *dev, int fr_mr, u32 lkey)
> cmd->lkey = lkey;
> cmd->rsvd_frmr = fr_mr ? 1 : 0;
> status = ocrdma_mbx_cmd(dev, (struct ocrdma_mqe *)cmd);
> - if (status)
> - goto mbx_err;
> -mbx_err:
> +
> kfree(cmd);
> return status;

Reviewed-by: Yuval Shaia <yuval.shaia@xxxxxxxxxx>

> }
> --
> 2.7.4
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
> the body of a message to majordomo@xxxxxxxxxxxxxxx
> More majordomo info at http://vger.kernel.org/majordomo-info.html