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

Message ID 20191105123759.25053-6-t-kristo@ti.com
State New
Headers show
Series
  • [1/6] crypto: omap-aes-gcm: fix failure with assocdata only
Related show

Commit Message

Tero Kristo Nov. 5, 2019, 12:37 p.m.
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(+)

-- 
2.17.1

--
Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki

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;