The d80211 stack still tries to free the WEP crypto ciphers, even when
allocating them previously has failed. This results in an oops.
Make sure that the d80211 stack only frees the crypto ciphers when they have
been allocated successfully.

Signed-off-by: Gertjan van Wingerde <[EMAIL PROTECTED]>

---
diff --git a/net/d80211/wep.c b/net/d80211/wep.c
index dee8eae..5abcda6 100644
--- a/net/d80211/wep.c
+++ b/net/d80211/wep.c
@@ -44,8 +44,10 @@ int ieee80211_wep_init(struct ieee80211_local *local)

void ieee80211_wep_free(struct ieee80211_local *local)
{
-       crypto_free_blkcipher(local->wep_tx_tfm);
-       crypto_free_blkcipher(local->wep_rx_tfm);
+       if (!IS_ERR(local->wep_tx_tfm))
+               crypto_free_blkcipher(local->wep_tx_tfm);
+       if (!IS_ERR(local->wep_rx_tfm))
+               crypto_free_blkcipher(local->wep_rx_tfm);
}

static inline int ieee80211_wep_weak_iv(u32 iv, int keylen)

-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to