aboutsummaryrefslogtreecommitdiff
path: root/crypto/scatterwalk.c
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/scatterwalk.c')
-rw-r--r--crypto/scatterwalk.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/crypto/scatterwalk.c b/crypto/scatterwalk.c
index 297e19d13c4..9aeeb52004a 100644
--- a/crypto/scatterwalk.c
+++ b/crypto/scatterwalk.c
@@ -105,6 +105,9 @@ void scatterwalk_map_and_copy(void *buf, struct scatterlist *sg,
struct scatter_walk walk;
unsigned int offset = 0;
+ if (!nbytes)
+ return;
+
for (;;) {
scatterwalk_start(&walk, sg);