]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
mac80211: return correct error return from ieee80211_wep_init
authorJeremy Fitzhardinge <jeremy@goop.org>
Mon, 14 Jul 2008 19:52:08 +0000 (12:52 -0700)
committerJohn W. Linville <linville@tuxdriver.com>
Tue, 29 Jul 2008 20:55:07 +0000 (16:55 -0400)
Return the proper error code rather than a hard-coded ENOMEM from
ieee80211_wep_init.  Also, print the error code on failure.

Signed-off-by: Jeremy Fitzhardinge <jeremy@goop.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
net/mac80211/main.c
net/mac80211/wep.c

index f1a83d450ea0a338d1464adbf3bdec2b48f5eff4..b5830f7055cf3ed822a512db6df0f9bbb2ffeb7c 100644 (file)
@@ -1731,8 +1731,8 @@ int ieee80211_register_hw(struct ieee80211_hw *hw)
        result = ieee80211_wep_init(local);
 
        if (result < 0) {
-               printk(KERN_DEBUG "%s: Failed to initialize wep\n",
-                      wiphy_name(local->hw.wiphy));
+               printk(KERN_DEBUG "%s: Failed to initialize wep: %d\n",
+                      wiphy_name(local->hw.wiphy), result);
                goto fail_wep;
        }
 
index 872d2fcd1a5b169495c19ca26bda925c3b89bdbd..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;