Merge tag 'xtensa-20181228' of git://github.com/jcmvbkbc/linux-xtensa
[linux-2.6-microblaze.git] / crypto / aead.c
index 60b3bbe..189c52d 100644 (file)
@@ -119,20 +119,16 @@ static int crypto_aead_report(struct sk_buff *skb, struct crypto_alg *alg)
        struct crypto_report_aead raead;
        struct aead_alg *aead = container_of(alg, struct aead_alg, base);
 
-       strncpy(raead.type, "aead", sizeof(raead.type));
-       strncpy(raead.geniv, "<none>", sizeof(raead.geniv));
+       memset(&raead, 0, sizeof(raead));
+
+       strscpy(raead.type, "aead", sizeof(raead.type));
+       strscpy(raead.geniv, "<none>", sizeof(raead.geniv));
 
        raead.blocksize = alg->cra_blocksize;
        raead.maxauthsize = aead->maxauthsize;
        raead.ivsize = aead->ivsize;
 
-       if (nla_put(skb, CRYPTOCFGA_REPORT_AEAD,
-                   sizeof(struct crypto_report_aead), &raead))
-               goto nla_put_failure;
-       return 0;
-
-nla_put_failure:
-       return -EMSGSIZE;
+       return nla_put(skb, CRYPTOCFGA_REPORT_AEAD, sizeof(raead), &raead);
 }
 #else
 static int crypto_aead_report(struct sk_buff *skb, struct crypto_alg *alg)