opa_vnic: fix check on record->event, incorrect operator used
Subsystems (2)
PATCH 1/1 opa_vnic: fix check on record->event, incorrect operator used
From: Colin Ian King <[email protected]>
The check on record->event is always true because the wrong operator is being used, used && instead of ||
Addresses-Coverity: ("Constant expression result")
--- drivers/infiniband/ulp/opa_vnic/opa_vnic_vema.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/infiniband/ulp/opa_vnic/opa_vnic_vema.c +1 -1
@@ -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 ;
Signature · 1 line
2.20.1
Quoted 18 lines · Colin King
From: Colin Ian King <[email protected]>
The check on
record->eventis 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 <[email protected]>--- drivers/infiniband/ulp/opa_vnic/opa_vnic_vema.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/infiniband/ulp/opa_vnic/opa_vnic_vema.c +0
-0
drivers/infiniband/ulp/opa_vnic/opa_vnic_vema.c static void opa_vnic_event(struct ib_event_handler *handler, · line 875
Quoted 8 lines
drivers/infiniband/ulp/opa_vnic/opa_vnic_vema.c +1
-1@@ -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!
Jason Gunthorpe
AppliedQuoted 26 lines · Dennis Dalessandro
Quoted 15 lines · Colin King
From: Colin Ian King <[email protected]>
The check on
record->eventis 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 <[email protected]>drivers/infiniband/ulp/opa_vnic/opa_vnic_vema.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/infiniband/ulp/opa_vnic/opa_vnic_vema.c +1
-0+++ b/drivers/infiniband/ulp/opa_vnic/opa_vnic_vema.cdrivers/infiniband/ulp/opa_vnic/opa_vnic_vema.c static void opa_vnic_event(struct ib_event_handler *handler, · line 874
Quoted 7 lines
drivers/infiniband/ulp/opa_vnic/opa_vnic_vema.c +1
-1@@ -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!
Quoted 1 line
Applied to for-next, thanks
Jason
Quoted 8 lines · Colin King
From: Colin Ian King <[email protected]>
The check on
record->eventis 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 <[email protected]>
Cheers,
-Mukesh
Quoted 17 lines
--- drivers/infiniband/ulp/opa_vnic/opa_vnic_vema.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/infiniband/ulp/opa_vnic/opa_vnic_vema.c +1
-1@@ -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 ;