Merge 4.14.107 into android-4.14-p
[GitHub/moto-9609/android_kernel_motorola_exynos9610.git] / crypto / xts.c
index d86c11a8c882c37ee7a7c2c18e41d54aaec25af8..e31828ed00466cc08e8ee2e73bacb2d99c1e0a34 100644 (file)
@@ -554,8 +554,10 @@ static int create(struct crypto_template *tmpl, struct rtattr **tb)
                ctx->name[len - 1] = 0;
 
                if (snprintf(inst->alg.base.cra_name, CRYPTO_MAX_ALG_NAME,
-                            "xts(%s)", ctx->name) >= CRYPTO_MAX_ALG_NAME)
-                       return -ENAMETOOLONG;
+                            "xts(%s)", ctx->name) >= CRYPTO_MAX_ALG_NAME) {
+                       err = -ENAMETOOLONG;
+                       goto err_drop_spawn;
+               }
        } else
                goto err_drop_spawn;