]> bbs.cooldavid.org Git - net-next-2.6.git/blobdiff - net/mac80211/aes_ccm.c
mac80211: Remove redundant checks for NULL before calls to crypto_free_cipher()
[net-next-2.6.git] / net / mac80211 / aes_ccm.c
index a87cb3ba2df6eeb146a94a4aba539e99b20b5889..4bd6ef0be38083aae25162a69250164b0afdab68 100644 (file)
@@ -138,10 +138,8 @@ struct crypto_cipher *ieee80211_aes_key_setup_encrypt(const u8 key[])
        struct crypto_cipher *tfm;
 
        tfm = crypto_alloc_cipher("aes", 0, CRYPTO_ALG_ASYNC);
-       if (IS_ERR(tfm))
-               return NULL;
-
-       crypto_cipher_setkey(tfm, key, ALG_CCMP_KEY_LEN);
+       if (!IS_ERR(tfm))
+               crypto_cipher_setkey(tfm, key, ALG_CCMP_KEY_LEN);
 
        return tfm;
 }
@@ -149,6 +147,5 @@ struct crypto_cipher *ieee80211_aes_key_setup_encrypt(const u8 key[])
 
 void ieee80211_aes_key_free(struct crypto_cipher *tfm)
 {
-       if (tfm)
-               crypto_free_cipher(tfm);
+       crypto_free_cipher(tfm);
 }