Merge tag 'armsoc-dt' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc
[linux-2.6-microblaze.git] / crypto / aead.c
index 189c52d..4908b5e 100644 (file)
@@ -61,8 +61,10 @@ int crypto_aead_setkey(struct crypto_aead *tfm,
        else
                err = crypto_aead_alg(tfm)->setkey(tfm, key, keylen);
 
-       if (err)
+       if (unlikely(err)) {
+               crypto_aead_set_flags(tfm, CRYPTO_TFM_NEED_KEY);
                return err;
+       }
 
        crypto_aead_clear_flags(tfm, CRYPTO_TFM_NEED_KEY);
        return 0;