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

Commit 5c817e35 authored by Ramandeep Trehan's avatar Ramandeep Trehan Committed by Gerrit - the friendly Code Review server
Browse files

crypto: qcedev: Add null pointer check on sg_src



Add a null pointer check on sg_src to avoid a possible
null pointer dereference in qcedev driver.

Change-Id: I9d4f9147ae6c340064110381c98d064f29fd9444
Signed-off-by: default avatarRamandeep Trehan <rtrehan@codeaurora.org>
parent 3faa5614
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -2445,6 +2445,9 @@ static int _qce_sps_add_sg_data(struct qce_device *pce_dev,
	struct sps_iovec *iovec = sps_bam_pipe->iovec +
						sps_bam_pipe->iovec_count;

	if (!sg_src)
		return -ENOENT;

	while (nbytes > 0) {
		len = min(nbytes, sg_dma_len(sg_src));
		nbytes -= len;