From: Colin Ian King Date: Thu, 4 Apr 2019 10:04:39 +0000 (+0100) Subject: opa_vnic: fix check on record->event, incorrect operator used X-Git-Tag: v5.2-rc1~114^2~95 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=4d2e11d42fe4117c24e79a012904cf0fa7fdcfe3;p=thirdparty%2Fkernel%2Flinux.git opa_vnic: fix check on record->event, incorrect operator used 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 Acked-by: Dennis Dalessandro Reviewed-by: Mukesh Ojha Signed-off-by: Jason Gunthorpe --- diff --git a/drivers/infiniband/ulp/opa_vnic/opa_vnic_vema.c b/drivers/infiniband/ulp/opa_vnic/opa_vnic_vema.c index 76cd09410d9aa..be5befd92d168 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;