Skip to contentSkip to conversation

cxgb3: fix device opening error path

PATCH Applied Divy Le Ray 2 participants 2 messages Oct 25, 2010

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 cxgb3: fix device opening error path

From: Divy Le Ray <[email protected]>

Only negative return from bind_qsets() should be considered an error and propagated.
It fixes an issue reported by IBM on P Series platform.

---

 drivers/net/cxgb3/cxgb3_main.c |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)
drivers/net/cxgb3/cxgb3_main.c +5 -3
index a04ce6a..4e3c123 100644
@@ -1266,11 +1266,13 @@ static int cxgb_up(struct adapter *adap)
 	}
 
 	if (!(adap->flags & QUEUES_BOUND)) {
-		err = bind_qsets(adap);
-		if (err) {
-			CH_ERR(adap, "failed to bind qsets, err %d\n", err);
+		int ret = bind_qsets(adap);
+
+		if (ret < 0) {
+			CH_ERR(adap, "failed to bind qsets, err %d\n", ret);
 			t3_intr_disable(adap);
 			free_irq_resources(adap);
+			err = ret;
 			goto out;
 		}
 		adap->flags |= QUEUES_BOUND;