Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8daa32b9 authored by Harsh Jain's avatar Harsh Jain Committed by Herbert Xu
Browse files

crypto: chelsio - check for sg null



Add warning message if sg is NULL after skipping bytes.

Reported-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarHarsh Jain <harsh@chelsio.com>
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
parent db6deea4
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -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);