On Fri, Sep 09, 2016 at 06:30:34PM +0800, Salil Mehta wrote:
> From: Lijun Ou <ouli...@huawei.com>
>
> The pointer ctrl may be null, so we add check for it.
>
> Signed-off-by: Lijun Ou <ouli...@huawei.com>
> Reviewed-by: Wei Hu <xavier.hu...@huawei.com>
> Signed-off-by: Salil Mehta <salil.me...@huawei.com>
> ---
>  drivers/infiniband/hw/hns/hns_roce_hw_v1.c |    6 ++++++
>  1 file changed, 6 insertions(+)
>
> diff --git a/drivers/infiniband/hw/hns/hns_roce_hw_v1.c 
> b/drivers/infiniband/hw/hns/hns_roce_hw_v1.c
> index 5f76fc1..ea47ec4 100644
> --- a/drivers/infiniband/hw/hns/hns_roce_hw_v1.c
> +++ b/drivers/infiniband/hw/hns/hns_roce_hw_v1.c
> @@ -336,6 +336,12 @@ int hns_roce_v1_post_recv(struct ib_qp *ibqp, struct 
> ib_recv_wr *wr,
>               }
>
>               ctrl = get_recv_wqe(hr_qp, ind);
> +             if (unlikely(!ctrl)) {

Yes, as you wrote, this check and patch are redundant too.

> +                     dev_err(dev, "Get recv wqe failed!\n");
> +                     ret = -EINVAL;
> +                     *bad_wr = wr;
> +                     goto out;
> +             }
>
>               roce_set_field(ctrl->rwqe_byte_12,
>                              RQ_WQE_CTRL_RWQE_BYTE_12_RWQE_SGE_NUM_M,
> --
> 1.7.9.5
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
> the body of a message to majord...@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

Attachment: signature.asc
Description: PGP signature

Reply via email to