diff options
Diffstat (limited to 'drivers/crypto/caam/sg_sw_sec4.h')
-rw-r--r-- | drivers/crypto/caam/sg_sw_sec4.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/crypto/caam/sg_sw_sec4.h b/drivers/crypto/caam/sg_sw_sec4.h index b12ff85..f1b30ec 100644 --- a/drivers/crypto/caam/sg_sw_sec4.h +++ b/drivers/crypto/caam/sg_sw_sec4.h @@ -62,7 +62,7 @@ static inline int __sg_count(struct scatterlist *sg_list, int nbytes, struct scatterlist *sg = sg_list; int sg_nents = 0; - while (nbytes > 0) { + while (nbytes > 0 && sg) { sg_nents++; nbytes -= sg->length; if (!sg_is_last(sg) && (sg + 1)->length == 0) |