Skip to content

Commit

Permalink
zd1211rw: Do not panic on device eject when associated
Browse files Browse the repository at this point in the history
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>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
  • Loading branch information
Jouni Malinen authored and John W. Linville committed Mar 16, 2009
1 parent 055249d commit 640c65e
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions drivers/net/wireless/zd1211rw/zd_mac.c
Original file line number Diff line number Diff line change
Expand Up @@ -575,13 +575,17 @@ static int zd_op_tx(struct ieee80211_hw *hw, struct sk_buff *skb)

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;
}

Expand Down

0 comments on commit 640c65e

Please sign in to comment.