lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Wed, 9 Sep 2020 13:38:56 -0300
From:   Jason Gunthorpe <jgg@...dia.com>
To:     Tong Zhang <ztong0001@...il.com>
CC:     <selvin.xavier@...adcom.com>, <devesh.sharma@...adcom.com>,
        <dledford@...hat.com>, <kamalheib1@...il.com>, <leon@...nel.org>,
        <maxg@...lanox.com>, <monis@...lanox.com>, <gustavoars@...nel.org>,
        <galpress@...zon.com>, <linux-rdma@...r.kernel.org>,
        <linux-kernel@...r.kernel.org>,
        Bernard Metzler <bmt@...ich.ibm.com>
Subject: Re: [PATCH] RDMA: error code handling

On Mon, Aug 24, 2020 at 07:44:21PM -0400, Tong Zhang wrote:
> ocrdma_qp_state_change() returns 1 when new and old state are the same,
> however caller is checking using <0
> 
> Signed-off-by: Tong Zhang <ztong0001@...il.com>
>  drivers/infiniband/hw/ocrdma/ocrdma_verbs.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/infiniband/hw/ocrdma/ocrdma_verbs.c b/drivers/infiniband/hw/ocrdma/ocrdma_verbs.c
> index c1751c9a0f62..518687c5e2cb 100644
> +++ b/drivers/infiniband/hw/ocrdma/ocrdma_verbs.c
> @@ -1384,7 +1384,7 @@ int _ocrdma_modify_qp(struct ib_qp *ibqp, struct ib_qp_attr *attr,
>  	/* if new and previous states are same hw doesn't need to
>  	 * know about it.
>  	 */
> -	if (status < 0)
> +	if (status == 1)
>  		return status;
>  	return ocrdma_mbx_modify_qp(dev, qp, attr, attr_mask);

I'm not comfortable with this patch unless someone from Broadcom
approves it.

Skipping the modify_qp just because the state is the same looks wrong
to me in the first place, I would rather see the dead code removed as
a no-change patch.

Jason

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ