]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
crypto: omap-des - handle NULL cipher request
authorTero Kristo <t-kristo@ti.com>
Tue, 5 Nov 2019 14:01:10 +0000 (16:01 +0200)
committerHerbert Xu <herbert@gondor.apana.org.au>
Wed, 11 Dec 2019 08:37:00 +0000 (16:37 +0800)
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>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
drivers/crypto/omap-des.c

index 31fc9300b990fa9792d9e4b5fe6a1f80df07e6a2..8eda433192040ac18e3a8fc7ce7fd18b54c9df49 100644 (file)
@@ -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;