Patchwork [02/10] drivers:crypto: return -ENOMEM on allocation failure.

login
register
mail settings
Submitter Allen
Date Sept. 13, 2017, 7:32 a.m.
Message ID <1505287939-14106-2-git-send-email-allen.lkml@gmail.com>
Download mbox | patch
Permalink /patch/9950487/
State Accepted
Delegated to: Herbert Xu
Headers show

Comments

Allen - Sept. 13, 2017, 7:32 a.m.
Signed-off-by: Allen Pais <allen.lkml@gmail.com>
---
 drivers/crypto/omap-aes-gcm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Herbert Xu - Oct. 7, 2017, 4:21 a.m.
Allen Pais <allen.lkml@gmail.com> wrote:
> Signed-off-by: Allen Pais <allen.lkml@gmail.com>

Patch applied.  Thanks.

Patch

diff --git a/drivers/crypto/omap-aes-gcm.c b/drivers/crypto/omap-aes-gcm.c
index 7d4f8a4..2542224 100644
--- a/drivers/crypto/omap-aes-gcm.c
+++ b/drivers/crypto/omap-aes-gcm.c
@@ -186,7 +186,7 @@  static int do_encrypt_iv(struct aead_request *req, u32 *tag, u32 *iv)
 	sk_req = skcipher_request_alloc(ctx->ctr, GFP_KERNEL);
 	if (!sk_req) {
 		pr_err("skcipher: Failed to allocate request\n");
-		return -1;
+		return -ENOMEM;
 	}
 
 	init_completion(&result.completion);