From 41c0303d162b0781e200167b59303c585c698c97 Mon Sep 17 00:00:00 2001 From: proski Date: Fri, 12 Mar 2010 05:40:29 +0000 Subject: [PATCH] Fix handling of out-of-memory condition in ccmp_attach() git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@4120 0192ed92-7a03-0410-a25b-9323aeb14dbd --- net80211/ieee80211_crypto_ccmp.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/net80211/ieee80211_crypto_ccmp.c b/net80211/ieee80211_crypto_ccmp.c index bf4d99b..646ae9c 100644 --- a/net80211/ieee80211_crypto_ccmp.c +++ b/net80211/ieee80211_crypto_ccmp.c @@ -107,6 +107,7 @@ ccmp_attach(struct ieee80211vap *vap, struct ieee80211_key *k) if (ctx == NULL) { vap->iv_stats.is_crypto_nomem++; status = 0; + goto out; } /* This function crypto_alloc_foo might sleep. Therefore: @@ -134,6 +135,7 @@ ccmp_attach(struct ieee80211vap *vap, struct ieee80211_key *k) } } +out: if (!status) _MOD_DEC_USE(THIS_MODULE); else { -- 2.35.1