summaryrefslogtreecommitdiffstats
path: root/drivers/crypto/chelsio
diff options
context:
space:
mode:
authorHarsh Jain <harsh@chelsio.com>2018-01-11 12:15:49 +0100
committerHerbert Xu <herbert@gondor.apana.org.au>2018-01-18 12:52:28 +0100
commit8daa32b9357de54eb68d78bbe668d52a83d24e71 (patch)
tree9081cfa3de71c62142445218655224a0ef09a8af /drivers/crypto/chelsio
parentcrypto: chelsio - Fix Indentation (diff)
downloadlinux-8daa32b9357de54eb68d78bbe668d52a83d24e71.tar.xz
linux-8daa32b9357de54eb68d78bbe668d52a83d24e71.zip
crypto: chelsio - check for sg null
Add warning message if sg is NULL after skipping bytes. Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Harsh Jain <harsh@chelsio.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'drivers/crypto/chelsio')
-rw-r--r--drivers/crypto/chelsio/chcr_algo.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/crypto/chelsio/chcr_algo.c b/drivers/crypto/chelsio/chcr_algo.c
index f6b11610ed5b..280377fc69e0 100644
--- a/drivers/crypto/chelsio/chcr_algo.c
+++ b/drivers/crypto/chelsio/chcr_algo.c
@@ -574,7 +574,8 @@ static void ulptx_walk_add_sg(struct ulptx_walk *walk,
skip = 0;
}
}
- if (walk->nents == 0) {
+ WARN(!sg, "SG should not be null here\n");
+ if (sg && (walk->nents == 0)) {
small = min_t(unsigned int, sg_dma_len(sg) - skip_len, len);
sgmin = min_t(unsigned int, small, CHCR_SRC_SG_SIZE);
walk->sgl->len0 = cpu_to_be32(sgmin);