From: Dennis Dalessandro Date: Thu, 04 Apr 2019 11:23:45 +0000 Subject: Re: [PATCH][next] opa_vnic: fix check on record->event, incorrect operator used Message-Id: List-Id: References: <20190404100439.19696-1-colin.king@canonical.com> In-Reply-To: <20190404100439.19696-1-colin.king@canonical.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Colin King , Niranjana Vishwanathapura , Doug Ledford , Jason Gunthorpe , linux-rdma@vger.kernel.org Cc: kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org On 4/4/2019 6:04 AM, Colin King wrote: > From: Colin Ian King > > The check on record->event is always true because the wrong operator > is being used, used && instead of || > > Addresses-Coverity: ("Constant expression result") > Fixes: fae7a699a925 ("opa_vnic: Convert vport_idr to XArray") > Signed-off-by: Colin Ian King > --- > drivers/infiniband/ulp/opa_vnic/opa_vnic_vema.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/infiniband/ulp/opa_vnic/opa_vnic_vema.c b/drivers/infiniband/ulp/opa_vnic/opa_vnic_vema.c > index 76cd09410d9a..be5befd92d16 100644 > --- a/drivers/infiniband/ulp/opa_vnic/opa_vnic_vema.c > +++ b/drivers/infiniband/ulp/opa_vnic/opa_vnic_vema.c > @@ -869,7 +869,7 @@ static void opa_vnic_event(struct ib_event_handler *handler, > record->event, dev_name(&record->device->dev), > record->element.port_num); > > - if (record->event != IB_EVENT_PORT_ERR || > + if (record->event != IB_EVENT_PORT_ERR && > record->event != IB_EVENT_PORT_ACTIVE) > return; > > Missed this in code review. Thanks! Acked-by: Dennis Dalessandro