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

Commit d6ccbf74 authored by Tanwee Kausar's avatar Tanwee Kausar
Browse files

crypto: msm: Fix null pointer dereference



Fixing possible null pointer dereference of sg_src
when nbytes exceed.

Change-Id: I91a2a274f11646bc65c4eb0d14a82d4ed81f4e42
Signed-off-by: default avatarTanwee Kausar <tkausar@codeaurora.org>
parent 734edfb3
Loading
Loading
Loading
Loading
+1 −4
Original line number Diff line number Diff line
@@ -2435,10 +2435,7 @@ 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) {
	while (nbytes > 0 && sg_src) {
		len = min(nbytes, sg_dma_len(sg_src));
		nbytes -= len;
		addr = sg_dma_address(sg_src);