diff options
Diffstat (limited to 'crypto/crypto_user.c')
-rw-r--r-- | crypto/crypto_user.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/crypto/crypto_user.c b/crypto/crypto_user.c index f76e42bcc6e7..84a5ac71ecb4 100644 --- a/crypto/crypto_user.c +++ b/crypto/crypto_user.c @@ -77,9 +77,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: @@ -92,9 +92,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: @@ -113,16 +113,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; } |