]> git.karo-electronics.de Git - mv-sheeva.git/blobdiff - net/mac80211/aes_cmac.c
mac80211: Remove redundant checks for NULL before calls to crypto_free_cipher()
[mv-sheeva.git] / net / mac80211 / aes_cmac.c
index 3d097b3d7b62ad86c94a86eec92a3b9b3554c526..d502b2684a664e317fcba3d629d463fef562b9aa 100644 (file)
@@ -119,10 +119,8 @@ struct crypto_cipher * ieee80211_aes_cmac_key_setup(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, AES_CMAC_KEY_LEN);
+       if (!IS_ERR(tfm))
+               crypto_cipher_setkey(tfm, key, AES_CMAC_KEY_LEN);
 
        return tfm;
 }
@@ -130,6 +128,5 @@ struct crypto_cipher * ieee80211_aes_cmac_key_setup(const u8 key[])
 
 void ieee80211_aes_cmac_key_free(struct crypto_cipher *tfm)
 {
-       if (tfm)
-               crypto_free_cipher(tfm);
+       crypto_free_cipher(tfm);
 }