mac80211: fix panic when using hardware WEP
authorPavel Roskin <proski@gnu.org>
Mon, 2 Jun 2008 11:54:50 +0000 (07:54 -0400)
committerJohn W. Linville <linville@tuxdriver.com>
Tue, 3 Jun 2008 19:00:29 +0000 (15:00 -0400)
e039fa4a4195ac4ee895e6f3d1334beed63256fe ("mac80211: move TX info into
skb->cb") misplaced code for setting hardware WEP keys.  Move it back.
This fixes kernel panic in b43 if WEP is used and hardware encryption
is enabled.

Signed-off-by: Pavel Roskin <proski@gnu.org>
Acked-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
net/mac80211/wep.c

index c9fd1291b19df47c1d981a4b84d5d3091c749f89..e7b6344c900a6f15005748b1f1650ab03eb5a1ec 100644 (file)
@@ -335,10 +335,10 @@ static int wep_encrypt_skb(struct ieee80211_tx_data *tx, struct sk_buff *skb)
        info->control.icv_len = WEP_ICV_LEN;
 
        if (!(tx->key->flags & KEY_FLAG_UPLOADED_TO_HARDWARE)) {
-               info->control.hw_key = &tx->key->conf;
                if (ieee80211_wep_encrypt(tx->local, skb, tx->key))
                        return -1;
        } else {
+               info->control.hw_key = &tx->key->conf;
                if (tx->key->conf.flags & IEEE80211_KEY_FLAG_GENERATE_IV) {
                        if (!ieee80211_wep_add_iv(tx->local, skb, tx->key))
                                return -1;