aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHerbert Xu <herbert@gondor.apana.org.au>2017-02-01 09:17:39 -0500
committerHerbert Xu <herbert@gondor.apana.org.au>2017-02-03 04:45:48 -0500
commitc26819900036f5b91608051a0fc7c76f6b4ffc7b (patch)
treeccffcd7a4410005c8ede82ec5435c85ad01c062b
parente5da5c5667381d2772374ee6a2967b3576c9483d (diff)
crypto: aesni - Fix failure when pcbc module is absent
When aesni is built as a module together with pcbc, the pcbc module must be present for aesni to load. However, the pcbc module may not be present for reasons such as its absence on initramfs. This patch allows the aesni to function even if the pcbc module is enabled but not present. Reported-by: Arkadiusz Miƛkiewicz <arekm@maven.pl> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
-rw-r--r--arch/x86/crypto/aesni-intel_glue.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/arch/x86/crypto/aesni-intel_glue.c b/arch/x86/crypto/aesni-intel_glue.c
index 6ef688a1ef3e..7ff1b0c86a8e 100644
--- a/arch/x86/crypto/aesni-intel_glue.c
+++ b/arch/x86/crypto/aesni-intel_glue.c
@@ -1085,9 +1085,9 @@ static void aesni_free_simds(void)
1085 aesni_simd_skciphers[i]; i++) 1085 aesni_simd_skciphers[i]; i++)
1086 simd_skcipher_free(aesni_simd_skciphers[i]); 1086 simd_skcipher_free(aesni_simd_skciphers[i]);
1087 1087
1088 for (i = 0; i < ARRAY_SIZE(aesni_simd_skciphers2) && 1088 for (i = 0; i < ARRAY_SIZE(aesni_simd_skciphers2); i++)
1089 aesni_simd_skciphers2[i].simd; i++) 1089 if (aesni_simd_skciphers2[i].simd)
1090 simd_skcipher_free(aesni_simd_skciphers2[i].simd); 1090 simd_skcipher_free(aesni_simd_skciphers2[i].simd);
1091} 1091}
1092 1092
1093static int __init aesni_init(void) 1093static int __init aesni_init(void)
@@ -1168,7 +1168,7 @@ static int __init aesni_init(void)
1168 simd = simd_skcipher_create_compat(algname, drvname, basename); 1168 simd = simd_skcipher_create_compat(algname, drvname, basename);
1169 err = PTR_ERR(simd); 1169 err = PTR_ERR(simd);
1170 if (IS_ERR(simd)) 1170 if (IS_ERR(simd))
1171 goto unregister_simds; 1171 continue;
1172 1172
1173 aesni_simd_skciphers2[i].simd = simd; 1173 aesni_simd_skciphers2[i].simd = simd;
1174 } 1174 }