Skip to contentSkip to conversation

orinoco: Clear dangling pointer on hardware busy

PATCH New [email protected] 1 participant 1 message Mar 22, 2011 Networking drivers (wireless)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 orinoco: Clear dangling pointer on hardware busy

On hardware busy the scan request pointer should be cleared, as higher levels will release. This avoids a crash when that pointer is erroneously used later.

---
When the hardware is busy the error is propagated to higher levels on the stack. Those layers release the buffer. Therefore the copy of the pointer must be erased. Otherwise subsequent events checking this pointer may crash.
---

drivers/net/wireless/orinoco/cfg.c +3 -0
index 09fae2f..736bbb9 100644
@@ -153,6 +153,9 @@ static int orinoco_scan(struct wiphy *wiphy, struct net_device *dev,
 	priv->scan_request = request;
 
 	err = orinoco_hw_trigger_scan(priv, request->ssids);
+	/* On error the we aren't processing the request */
+	if (err)
+		priv->scan_request = NULL;
 
 	return err;
 }