Skip to contentSkip to conversation

infiniband: hw: cxgb4: fix error return code of close_listsrv_rpl()

PATCH In review Jia-Ju Bai 2 participants 2 messages Mar 6, 2021 – Mar 7, 2021

Subsystems (2)
lore
Share & tools
lore

Jia-Ju Bai

author
#0 lore raw

PATCH 1/1 infiniband: hw: cxgb4: fix error return code of close_listsrv_rpl()

When ep is NULL, no error code of close_listsrv_rpl() is returned. To fix this bug, close_listsrv_rpl() returns -EINVAL in this case.

---
 drivers/infiniband/hw/cxgb4/cm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/infiniband/hw/cxgb4/cm.c +1 -1
index 8769e7aa097f..94492d2dfdc7 100644
@@ -2400,7 +2400,7 @@ static int close_listsrv_rpl(struct c4iw_dev *dev, struct sk_buff *skb)
 
 	if (!ep) {
 		pr_warn("%s stid %d lookup failure!\n", __func__, stid);
-		goto out;
+		return -EINVAL;
 	}
 	pr_debug("ep %p\n", ep);
 	c4iw_wake_up_noref(ep->com.wr_waitp, status2errno(rpl->status));
Signature · 1 line
2.17.1
#1 lore raw
Quoted 2 lines · Jia-Ju Bai

When ep is NULL, no error code of close_listsrv_rpl() is returned. To fix this bug, close_listsrv_rpl() returns -EINVAL in this case.

I don't think that this is an error.

Quoted 23 lines
---
 drivers/infiniband/hw/cxgb4/cm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/infiniband/hw/cxgb4/cm.c +1 -2
index 8769e7aa097f..94492d2dfdc7 100644
@@ -2400,7 +2400,7 @@ static int close_listsrv_rpl(struct c4iw_dev *dev, struct sk_buff *skb)
 
 	if (!ep) {
 		pr_warn("%s stid %d lookup failure!\n", __func__, stid);
-		goto out;
+		return -EINVAL;
 	}
 	pr_debug("ep %p\n", ep);
 	c4iw_wake_up_noref(ep->com.wr_waitp, status2errno(rpl->status));
--

2.17.1