summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLinux Build Service Account <lnxbuild@localhost>2018-09-26 10:40:00 -0700
committerGerrit - the friendly Code Review server <code-review@localhost>2018-09-26 10:39:59 -0700
commitcc27d876cdb97c963abf58ff5eea6232e983fa36 (patch)
treee7dee84a12cfbf3f32a4b672fb47a5378f9d1be1
parent22802b03adca469b6f9ec44bb49c9285ba6b4da6 (diff)
parent6523651f7d08b4456d15c702ef2285f021362b74 (diff)
Merge "wqcrypto: qcedev: Add null pointer check on sg_src"
-rw-r--r--drivers/crypto/msm/qce50.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/crypto/msm/qce50.c b/drivers/crypto/msm/qce50.c
index b44f926a6ba0..598b1aa0f4d7 100644
--- a/drivers/crypto/msm/qce50.c
+++ b/drivers/crypto/msm/qce50.c
@@ -1,6 +1,6 @@
/* Qualcomm Crypto Engine driver.
*
- * Copyright (c) 2012-2017, The Linux Foundation. All rights reserved.
+ * Copyright (c) 2012-2018, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
@@ -2440,6 +2440,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;