]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - net/mac80211/wep.c
mac80211: return correct error return from ieee80211_wep_init
[linux-2.6-omap-h63xx.git] / net / mac80211 / wep.c
index 35b664d00e239e2e65b80c5504900b5290a329d2..5c2bf0a3d4db67a7e4c7a8c55a3b4cb997b86cdb 100644 (file)
@@ -31,13 +31,13 @@ int ieee80211_wep_init(struct ieee80211_local *local)
        local->wep_tx_tfm = crypto_alloc_blkcipher("ecb(arc4)", 0,
                                                CRYPTO_ALG_ASYNC);
        if (IS_ERR(local->wep_tx_tfm))
-               return -ENOMEM;
+               return PTR_ERR(local->wep_tx_tfm);
 
        local->wep_rx_tfm = crypto_alloc_blkcipher("ecb(arc4)", 0,
                                                CRYPTO_ALG_ASYNC);
        if (IS_ERR(local->wep_rx_tfm)) {
                crypto_free_blkcipher(local->wep_tx_tfm);
-               return -ENOMEM;
+               return PTR_ERR(local->wep_rx_tfm);
        }
 
        return 0;
@@ -253,11 +253,8 @@ int ieee80211_wep_decrypt(struct ieee80211_local *local, struct sk_buff *skb,
 
        if (ieee80211_wep_decrypt_data(local->wep_rx_tfm, rc4key, klen,
                                       skb->data + hdrlen + WEP_IV_LEN,
-                                      len)) {
-               if (net_ratelimit())
-                       printk(KERN_DEBUG "WEP decrypt failed (ICV)\n");
+                                      len))
                ret = -1;
-       }
 
        kfree(rc4key);
 
@@ -301,14 +298,8 @@ ieee80211_crypto_wep_decrypt(struct ieee80211_rx_data *rx)
                return RX_CONTINUE;
 
        if (!(rx->status->flag & RX_FLAG_DECRYPTED)) {
-               if (ieee80211_wep_decrypt(rx->local, rx->skb, rx->key)) {
-#ifdef CONFIG_MAC80211_DEBUG
-                       if (net_ratelimit())
-                               printk(KERN_DEBUG "%s: RX WEP frame, decrypt "
-                                      "failed\n", rx->dev->name);
-#endif /* CONFIG_MAC80211_DEBUG */
+               if (ieee80211_wep_decrypt(rx->local, rx->skb, rx->key))
                        return RX_DROP_UNUSABLE;
-               }
        } else if (!(rx->status->flag & RX_FLAG_IV_STRIPPED)) {
                ieee80211_wep_remove_iv(rx->local, rx->skb, rx->key);
                /* remove ICV */