* [PATCH] zd1211rw: Do not panic on device eject when associated
@ 2009-03-16 19:47 Jouni Malinen
2009-03-16 22:08 ` Alina Friedrichsen
2009-03-17 23:30 ` Johannes Berg
0 siblings, 2 replies; 3+ messages in thread
From: Jouni Malinen @ 2009-03-16 19:47 UTC (permalink / raw)
To: Daniel Drake, Ulrich Kunitz, John W. Linville; +Cc: linux-wireless
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>
---
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;
}
--
Jouni Malinen PGP id EFC895FA
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] zd1211rw: Do not panic on device eject when associated
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
1 sibling, 0 replies; 3+ messages in thread
From: Alina Friedrichsen @ 2009-03-16 22:08 UTC (permalink / raw)
To: Jouni Malinen, linville, kune, dsd; +Cc: linux-wireless
Hello Jouni,
Thanks! :)
Regards
Alina
--=20
Neu: GMX FreeDSL Komplettanschluss mit DSL 6.000 Flatrate + Telefonansc=
hluss f=FCr nur 17,95 Euro/mtl.!* http://dsl.gmx.de/?ac=3DOM.AD.PD003K1=
1308T4569a
--
To unsubscribe from this list: send the line "unsubscribe linux-wireles=
s" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] zd1211rw: Do not panic on device eject when associated
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
1 sibling, 0 replies; 3+ messages in thread
From: Johannes Berg @ 2009-03-17 23:30 UTC (permalink / raw)
To: Jouni Malinen
Cc: Daniel Drake, Ulrich Kunitz, John W. Linville, linux-wireless
[-- 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 --]
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2009-03-17 23:31 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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 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.