All of lore.kernel.org
 help / color / mirror / Atom feed
* Flag this message [PATCH 2.6.38-rc8-wl 1/1] orinoco: Clear dangling pointer on hardware busy
@ 2011-03-15 15:35 Joe Gunn
  0 siblings, 0 replies; only message in thread
From: Joe Gunn @ 2011-03-15 15:35 UTC (permalink / raw)
  To: orinoco-devel; +Cc: linux-wireless

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.

Signed-off-by: Joseph J. Gunn <armadefuego@yahoo.com>
---
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 ma crash.
---
diff --git a/drivers/net/wireless/orinoco/cfg.c b/drivers/net/wireless/orinoco/cfg.c
index 09fae2f..1eff4dc 100644
--- a/drivers/net/wireless/orinoco/cfg.c
+++ b/drivers/net/wireless/orinoco/cfg.c
@@ -151,8 +151,18 @@ static int orinoco_scan(struct wiphy *wiphy, struct net_device *dev,
 		return -EBUSY;
 
 	priv->scan_request = request;
+	DEBUG(3, "orinoco_scan():"
+		" scan_request %p wiphy %p, dev %p\n",
+		priv->scan_request,
+		priv->scan_request->wiphy,
+		priv->scan_request->dev
+		);
 
 	err = orinoco_hw_trigger_scan(priv, request->ssids);
+	/* On EBUSY the hardware is busy. We aren't processing the request */
+	if ( err == -EBUSY) {
+		priv->scan_request = NULL;
+	}
 
 	return err;
 }
diff --git a/drivers/net/wireless/orinoco/scan.c b/drivers/net/wireless/orinoco/scan.c
index e99ca1c..698e9ff 100644
--- a/drivers/net/wireless/orinoco/scan.c
+++ b/drivers/net/wireless/orinoco/scan.c
@@ -230,6 +230,12 @@ void orinoco_add_hostscan_results(struct orinoco_private *priv,
 
  scan_abort:
 	if (priv->scan_request) {
+		DEBUG(3, "orinoco_add_hostscan_results():"
+			" scan_request %p wiphy %p, dev %p\n",
+			priv->scan_request,
+			priv->scan_request->wiphy,
+			priv->scan_request->dev
+			);
 		cfg80211_scan_done(priv->scan_request, abort);
 		priv->scan_request = NULL;
 	}
@@ -238,6 +244,12 @@ void orinoco_add_hostscan_results(struct orinoco_private *priv,
 void orinoco_scan_done(struct orinoco_private *priv, bool abort)
 {
 	if (priv->scan_request) {
+		DEBUG(3, "orinoco_scan_done():"
+			" scan_request %p, wiphy %p, dev %p\n",
+			priv->scan_request,
+			priv->scan_request->wiphy,
+			priv->scan_request->dev
+			);
 		cfg80211_scan_done(priv->scan_request, abort);
 		priv->scan_request = NULL;
 	}



      

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2011-03-15 15:35 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-03-15 15:35 Flag this message [PATCH 2.6.38-rc8-wl 1/1] orinoco: Clear dangling pointer on hardware busy Joe Gunn

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.