Fix handling of out-of-memory condition in ccmp_attach()
authorproski <proski@0192ed92-7a03-0410-a25b-9323aeb14dbd>
Fri, 12 Mar 2010 05:40:29 +0000 (05:40 +0000)
committerproski <proski@0192ed92-7a03-0410-a25b-9323aeb14dbd>
Fri, 12 Mar 2010 05:40:29 +0000 (05:40 +0000)
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@4120 0192ed92-7a03-0410-a25b-9323aeb14dbd

net80211/ieee80211_crypto_ccmp.c

index bf4d99be300da399c504883fb1f5a8bbfa9da35d..646ae9c81af93c17f7ddf20ca486bb214f32bef1 100644 (file)
@@ -107,6 +107,7 @@ ccmp_attach(struct ieee80211vap *vap, struct ieee80211_key *k)
        if (ctx == NULL) {
                vap->iv_stats.is_crypto_nomem++;
                status = 0;
        if (ctx == NULL) {
                vap->iv_stats.is_crypto_nomem++;
                status = 0;
+               goto out;
        }
 
 /* This function crypto_alloc_foo might sleep. Therefore:
        }
 
 /* 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 {
        if (!status)
                _MOD_DEC_USE(THIS_MODULE);
        else {