crypto: pcbc - remove bogus memcpy()s with src == dest
[GitHub/moto-9609/android_kernel_motorola_exynos9610.git] / crypto / testmgr.c
index 7125ba3880afd612e08ba6dbb331ab6449da8b24..d91278c01ea89a36bb4d72abdde637e42175ec2e 100644 (file)
@@ -1839,14 +1839,21 @@ static int alg_test_crc32c(const struct alg_test_desc *desc,
 
        err = alg_test_hash(desc, driver, type, mask);
        if (err)
-               goto out;
+               return err;
 
        tfm = crypto_alloc_shash(driver, type, mask);
        if (IS_ERR(tfm)) {
+               if (PTR_ERR(tfm) == -ENOENT) {
+                       /*
+                        * This crc32c implementation is only available through
+                        * ahash API, not the shash API, so the remaining part
+                        * of the test is not applicable to it.
+                        */
+                       return 0;
+               }
                printk(KERN_ERR "alg: crc32c: Failed to load transform for %s: "
                       "%ld\n", driver, PTR_ERR(tfm));
-               err = PTR_ERR(tfm);
-               goto out;
+               return PTR_ERR(tfm);
        }
 
        do {
@@ -1873,7 +1880,6 @@ static int alg_test_crc32c(const struct alg_test_desc *desc,
 
        crypto_free_shash(tfm);
 
-out:
        return err;
 }