Skip to contentSkip to conversation

opa_vnic: fix check on record->event, incorrect operator used

PATCH Applied Colin King 4 participants 4 messages Apr 4, 2019

Subsystems (2)
lore
Share & tools
lore

Colin King

author
#0 lore raw

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")

Fixes fae7a699a925 ("opa_vnic: Convert vport_idr to XArray")
---
 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
index 76cd09410d9a..be5befd92d16 100644
@@ -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
Acked-by on v1 1/1
#1 lore raw
Quoted 18 lines · Colin King

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")

Fixes fae7a699a925 ("opa_vnic: Convert vport_idr to XArray")
---
  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
index 76cd09410d9a..be5befd92d16 100644

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!

#2 lore raw
Quoted 26 lines · Dennis Dalessandro
Quoted 15 lines · Colin King

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")

Fixes fae7a699a925 ("opa_vnic: Convert vport_idr to XArray")
  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
index 76cd09410d9a..be5befd92d16 100644
+++ b/drivers/infiniband/ulp/opa_vnic/opa_vnic_vema.c

drivers/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

Reviewed-by on v1 1/1
#3 lore raw
In reply to Colin King
Quoted 8 lines · Colin King

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")

Fixes fae7a699a925 ("opa_vnic: Convert vport_idr to XArray")

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
index 76cd09410d9a..be5befd92d16 100644
@@ -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;