diff mbox series

[5/6] crypto: omap-des: handle NULL cipher request

Message ID 20191105123759.25053-6-t-kristo@ti.com (mailing list archive)
State Superseded
Delegated to: Herbert Xu
Headers show
Series crypto: omap: fix extra tests with crypto manager | expand

Commit Message

Tero Kristo Nov. 5, 2019, 12:37 p.m. UTC
If no data is provided for DES request, just return immediately. No
processing is needed in this case.

Signed-off-by: Tero Kristo <t-kristo@ti.com>
---
 drivers/crypto/omap-des.c | 3 +++
 1 file changed, 3 insertions(+)
diff mbox series

Patch

diff --git a/drivers/crypto/omap-des.c b/drivers/crypto/omap-des.c
index d1d839164048..7a9491b7b8eb 100644
--- a/drivers/crypto/omap-des.c
+++ b/drivers/crypto/omap-des.c
@@ -637,6 +637,9 @@  static int omap_des_crypt(struct skcipher_request *req, unsigned long mode)
 		 !!(mode & FLAGS_ENCRYPT),
 		 !!(mode & FLAGS_CBC));
 
+	if (!req->cryptlen)
+		return 0;
+
 	if (!IS_ALIGNED(req->cryptlen, DES_BLOCK_SIZE))
 		return -EINVAL;