summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorIngo Molnar <mingo@kernel.org>2017-06-20 10:48:44 +0200
committerIngo Molnar <mingo@kernel.org>2017-06-20 10:48:44 +0200
commit2eb0fc9bfe7485fec16030b85ff586e7aaea2b6f (patch)
treeb804e48f8aba794030f3610199b0f20140e6c6a8 /lib
parentd0fabd1cb8b70073a0f44f1cf8b663b5e7241c74 (diff)
parent41f1830f5a7af77cf5c86359aba3cbd706687e52 (diff)
downloadlinux-2eb0fc9bfe7485fec16030b85ff586e7aaea2b6f.tar.gz
linux-2eb0fc9bfe7485fec16030b85ff586e7aaea2b6f.zip
Merge tag 'v4.12-rc6' into perf/core, to pick up fixes
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'lib')
-rw-r--r--lib/libcrc32c.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/libcrc32c.c b/lib/libcrc32c.c
index 74a54b7f2562..9f79547d1b97 100644
--- a/lib/libcrc32c.c
+++ b/lib/libcrc32c.c
@@ -43,7 +43,7 @@ static struct crypto_shash *tfm;
u32 crc32c(u32 crc, const void *address, unsigned int length)
{
SHASH_DESC_ON_STACK(shash, tfm);
- u32 *ctx = (u32 *)shash_desc_ctx(shash);
+ u32 ret, *ctx = (u32 *)shash_desc_ctx(shash);
int err;
shash->tfm = tfm;
@@ -53,7 +53,9 @@ u32 crc32c(u32 crc, const void *address, unsigned int length)
err = crypto_shash_update(shash, address, length);
BUG_ON(err);
- return *ctx;
+ ret = *ctx;
+ barrier_data(ctx);
+ return ret;
}
EXPORT_SYMBOL(crc32c);