Commit c2681990 authored by Herbert Xu's avatar Herbert Xu

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: default avatarArkadiusz Miśkiewicz <arekm@maven.pl>
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
parent e5da5c56
...@@ -1085,9 +1085,9 @@ static void aesni_free_simds(void) ...@@ -1085,9 +1085,9 @@ static void aesni_free_simds(void)
aesni_simd_skciphers[i]; i++) aesni_simd_skciphers[i]; i++)
simd_skcipher_free(aesni_simd_skciphers[i]); simd_skcipher_free(aesni_simd_skciphers[i]);
for (i = 0; i < ARRAY_SIZE(aesni_simd_skciphers2) && for (i = 0; i < ARRAY_SIZE(aesni_simd_skciphers2); i++)
aesni_simd_skciphers2[i].simd; i++) if (aesni_simd_skciphers2[i].simd)
simd_skcipher_free(aesni_simd_skciphers2[i].simd); simd_skcipher_free(aesni_simd_skciphers2[i].simd);
} }
static int __init aesni_init(void) static int __init aesni_init(void)
...@@ -1168,7 +1168,7 @@ static int __init aesni_init(void) ...@@ -1168,7 +1168,7 @@ static int __init aesni_init(void)
simd = simd_skcipher_create_compat(algname, drvname, basename); simd = simd_skcipher_create_compat(algname, drvname, basename);
err = PTR_ERR(simd); err = PTR_ERR(simd);
if (IS_ERR(simd)) if (IS_ERR(simd))
goto unregister_simds; continue;
aesni_simd_skciphers2[i].simd = simd; aesni_simd_skciphers2[i].simd = simd;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment