linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Johannes Berg <johannes@sipsolutions.net>
To: Jouni Malinen <j@w1.fi>
Cc: Daniel Drake <dsd@gentoo.org>,
	Ulrich Kunitz <kune@deine-taler.de>,
	"John W. Linville" <linville@tuxdriver.com>,
	linux-wireless@vger.kernel.org
Subject: Re: [PATCH] zd1211rw: Do not panic on device eject when associated
Date: Wed, 18 Mar 2009 00:30:42 +0100	[thread overview]
Message-ID: <1237332642.5100.10.camel@johannes.local> (raw)
In-Reply-To: <20090316194733.GA23062@jm.kir.nu> (sfid-20090316_204748_435020_3BB72D18)

[-- Attachment #1: Type: text/plain, Size: 1235 bytes --]

On Mon, 2009-03-16 at 21:47 +0200, Jouni Malinen wrote:
> zd_op_tx() must not return an arbitrary error value since that can
> leave mac80211 trying to retransmit the frame and with the extra data
> pushed into the beginning of the skb on every attempt, this will end up
> causing a kernel panic (skb_under_panic from skb_push call). This can
> happen, e.g., when ejecting the device when associated.
> 
> Signed-off-by: Jouni Malinen <j@w1.fi>

Should be for the various stable versions too. All of them, most likely.

johannes

> ---
>  drivers/net/wireless/zd1211rw/zd_mac.c |    8 ++++++--
>  1 file changed, 6 insertions(+), 2 deletions(-)
> 
> --- wireless-testing.orig/drivers/net/wireless/zd1211rw/zd_mac.c	2009-02-28 00:24:24.000000000 +0200
> +++ wireless-testing/drivers/net/wireless/zd1211rw/zd_mac.c	2009-03-16 21:44:07.000000000 +0200
> @@ -575,13 +575,17 @@ static int zd_op_tx(struct ieee80211_hw 
>  
>  	r = fill_ctrlset(mac, skb);
>  	if (r)
> -		return r;
> +		goto fail;
>  
>  	info->rate_driver_data[0] = hw;
>  
>  	r = zd_usb_tx(&mac->chip.usb, skb);
>  	if (r)
> -		return r;
> +		goto fail;
> +	return 0;
> +
> +fail:
> +	dev_kfree_skb(skb);
>  	return 0;
>  }
>  
> 

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

      parent reply	other threads:[~2009-03-17 23:31 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-16 19:47 [PATCH] zd1211rw: Do not panic on device eject when associated Jouni Malinen
2009-03-16 22:08 ` Alina Friedrichsen
2009-03-17 23:30 ` Johannes Berg [this message]

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=1237332642.5100.10.camel@johannes.local \
    --to=johannes@sipsolutions.net \
    --cc=dsd@gentoo.org \
    --cc=j@w1.fi \
    --cc=kune@deine-taler.de \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linville@tuxdriver.com \
    /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).