mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-09 13:49:24 -04:00
crypto: msm: Fix null pointer dereference
Fixing possible null pointer dereference of sg_src when nbytes exceed. Change-Id: I91a2a274f11646bc65c4eb0d14a82d4ed81f4e42 Signed-off-by: Tanwee Kausar <tkausar@codeaurora.org>
This commit is contained in:
parent
734edfb319
commit
d6ccbf749e
1 changed files with 1 additions and 4 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in a new issue