Re: [PATCH rdma-next] RDMA/cxgb4: remove unnecessary NULL check in __c4iw_poll_cq_one()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Dec 15, 2022 at 03:30:30PM +0300, Alexey Kodanev wrote:
> If 'qhp' is NULL then 'wq' is also NULL:
> 
>     struct t4_wq *wq = qhp ? &qhp->wq : NULL;
>     ...
>     ret = poll_cq(wq, ...);
>     if (ret)
>         goto out;
> 
> poll_cq(wq, ...) always returns a non-zero status if 'wq' is NULL,
> either on a t4_next_cqe() error or on a 'wq == NULL' check.
> 
> Therefore, checking 'qhp' again after poll_cq() is redundant.
> 
> BTW, there're also 'qhp' dereference cases below poll_cq() without
> any checks (c4iw_invalidate_mr(qhp->rhp,...)).
> 
> Detected using the static analysis tool - Svace.
> Fixes: 4ab39e2f98f2 ("RDMA/cxgb4: Make c4iw_poll_cq_one() easier to analyze")
> Signed-off-by: Alexey Kodanev <aleksei.kodanev@xxxxxxxxxxx>
> ---
>  drivers/infiniband/hw/cxgb4/cq.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 

Let's wait till merge window ends.

Thanks,
Reviewed-by: Leon Romanovsky <leonro@xxxxxxxxxx>



[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux