From: Gertjan van Wingerde <gwingerde@kpnplanet.nl>
To: Jiri Benc <jbenc@suse.cz>, netdev@vger.kernel.org
Subject: [PATCH] d80211: Only free WEP crypto ciphers when they have been allocated correctly.
Date: Sat, 06 Jan 2007 18:00:52 +0100 [thread overview]
Message-ID: <459FD5C4.9070301@kpnplanet.nl> (raw)
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 <gwingerde@kpnplanet.nl>
---
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)
next reply other threads:[~2007-01-06 17:15 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-01-06 17:00 Gertjan van Wingerde [this message]
2007-01-06 17:29 ` [PATCH] d80211: Only free WEP crypto ciphers when they have been allocated correctly Michael Wu
2007-01-06 18:14 ` Gertjan van Wingerde
2007-01-10 20:14 ` Jiri Benc
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=459FD5C4.9070301@kpnplanet.nl \
--to=gwingerde@kpnplanet.nl \
--cc=jbenc@suse.cz \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).