aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Documentation/crypto/api-intro.txt2
-rw-r--r--crypto/scatterwalk.c4
-rw-r--r--crypto/tcrypt.c2
3 files changed, 4 insertions, 4 deletions
diff --git a/Documentation/crypto/api-intro.txt b/Documentation/crypto/api-intro.txt
index e41a79aa71c..9b84b805ab7 100644
--- a/Documentation/crypto/api-intro.txt
+++ b/Documentation/crypto/api-intro.txt
@@ -60,7 +60,7 @@ Here's an example of how to use the API:
desc.tfm = tfm;
desc.flags = 0;
- if (crypto_hash_digest(&desc, &sg, 2, result))
+ if (crypto_hash_digest(&desc, sg, 2, result))
fail();
crypto_free_hash(tfm);
diff --git a/crypto/scatterwalk.c b/crypto/scatterwalk.c
index 35172d3f043..a6642312177 100644
--- a/crypto/scatterwalk.c
+++ b/crypto/scatterwalk.c
@@ -91,6 +91,8 @@ void scatterwalk_copychunks(void *buf, struct scatter_walk *walk,
memcpy_dir(buf, vaddr, len_this_page, out);
scatterwalk_unmap(vaddr, out);
+ scatterwalk_advance(walk, nbytes);
+
if (nbytes == len_this_page)
break;
@@ -99,7 +101,5 @@ void scatterwalk_copychunks(void *buf, struct scatter_walk *walk,
scatterwalk_pagedone(walk, out, 1);
}
-
- scatterwalk_advance(walk, nbytes);
}
EXPORT_SYMBOL_GPL(scatterwalk_copychunks);
diff --git a/crypto/tcrypt.c b/crypto/tcrypt.c
index f5e9da319ec..8eaa5aa210b 100644
--- a/crypto/tcrypt.c
+++ b/crypto/tcrypt.c
@@ -768,7 +768,7 @@ static void test_deflate(void)
tv = (void *)tvmem;
tfm = crypto_alloc_comp("deflate", 0, CRYPTO_ALG_ASYNC);
- if (tfm == NULL) {
+ if (IS_ERR(tfm)) {
printk("failed to load transform for deflate\n");
return;
}