Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
[sfrench/cifs-2.6.git] / crypto / crypto_user.c
index f1ea0a0641350cbd0f7628bc3e7edde4fc38972d..5a37eadb4e56da5c922bab5167a295432e3cca3a 100644 (file)
@@ -81,9 +81,9 @@ static int crypto_report_cipher(struct sk_buff *skb, struct crypto_alg *alg)
        rcipher.min_keysize = alg->cra_cipher.cia_min_keysize;
        rcipher.max_keysize = alg->cra_cipher.cia_max_keysize;
 
-       NLA_PUT(skb, CRYPTOCFGA_REPORT_CIPHER,
-               sizeof(struct crypto_report_cipher), &rcipher);
-
+       if (nla_put(skb, CRYPTOCFGA_REPORT_CIPHER,
+                   sizeof(struct crypto_report_cipher), &rcipher))
+               goto nla_put_failure;
        return 0;
 
 nla_put_failure:
@@ -96,9 +96,9 @@ static int crypto_report_comp(struct sk_buff *skb, struct crypto_alg *alg)
 
        snprintf(rcomp.type, CRYPTO_MAX_ALG_NAME, "%s", "compression");
 
-       NLA_PUT(skb, CRYPTOCFGA_REPORT_COMPRESS,
-               sizeof(struct crypto_report_comp), &rcomp);
-
+       if (nla_put(skb, CRYPTOCFGA_REPORT_COMPRESS,
+                   sizeof(struct crypto_report_comp), &rcomp))
+               goto nla_put_failure;
        return 0;
 
 nla_put_failure:
@@ -117,16 +117,16 @@ static int crypto_report_one(struct crypto_alg *alg,
        ualg->cru_flags = alg->cra_flags;
        ualg->cru_refcnt = atomic_read(&alg->cra_refcnt);
 
-       NLA_PUT_U32(skb, CRYPTOCFGA_PRIORITY_VAL, alg->cra_priority);
-
+       if (nla_put_u32(skb, CRYPTOCFGA_PRIORITY_VAL, alg->cra_priority))
+               goto nla_put_failure;
        if (alg->cra_flags & CRYPTO_ALG_LARVAL) {
                struct crypto_report_larval rl;
 
                snprintf(rl.type, CRYPTO_MAX_ALG_NAME, "%s", "larval");
 
-               NLA_PUT(skb, CRYPTOCFGA_REPORT_LARVAL,
-                       sizeof(struct crypto_report_larval), &rl);
-
+               if (nla_put(skb, CRYPTOCFGA_REPORT_LARVAL,
+                           sizeof(struct crypto_report_larval), &rl))
+                       goto nla_put_failure;
                goto out;
        }