linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dave Kilroy <kilroyd@googlemail.com>
To: armadefuego@gmail.com
Cc: orinoco-devel@lists.sourceforge.net, linux-wireless@vger.kernel.org
Subject: Re: [PATCH 2.6.38-rc8-wl RESEND] orinoco: Clear dangling pointer on hardware busy
Date: Mon, 21 Mar 2011 22:40:32 +0000	[thread overview]
Message-ID: <4D87D3E0.4080408@gmail.com> (raw)
In-Reply-To: <4d870a8a.8735e50a.41c9.134e@mx.google.com>

On 21/03/2011 08:21, armadefuego@gmail.com wrote:
> 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.

I think you need to add line breaks for the git log

> 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..2022815 100644
> --- a/drivers/net/wireless/orinoco/cfg.c
> +++ b/drivers/net/wireless/orinoco/cfg.c
> @@ -151,8 +151,17 @@ 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)

We should reset priv->scan_request on all errors, not just -EBUSY. Were 
you getting this in a particular situation? If so, highlighting it in 
the commit log is useful.

I notice -EBUSY is returned when we can't get the orinoco_lock - are you 
having an issue with lock cotention on a particular device?

> +		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
> +			);

I'm not a big fan of scattering DEBUG statements about, but if we're 
going to, use __FUNCTION__ (or whatever the C99 incarnation is) rather 
than explicitly naming the functions.


Dave.

  reply	other threads:[~2011-03-21 22:40 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-21  8:21 [PATCH 2.6.38-rc8-wl RESEND] orinoco: Clear dangling pointer on hardware busy armadefuego
2011-03-21 22:40 ` Dave Kilroy [this message]
2011-03-22  2:45   ` [Orinoco-devel] " Joe Gunn
2011-03-22  9:45     ` Kalle Valo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4D87D3E0.4080408@gmail.com \
    --to=kilroyd@googlemail.com \
    --cc=armadefuego@gmail.com \
    --cc=linux-wireless@vger.kernel.org \
    --cc=orinoco-devel@lists.sourceforge.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).