aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/lib
diff options
context:
space:
mode:
authorIngo Molnar <mingo@kernel.org>2017-06-22 10:19:14 +0200
committerIngo Molnar <mingo@kernel.org>2017-06-22 10:19:14 +0200
commitf9e169883164390a15b56d00cb7e22c2e72f4dba (patch)
tree2a946cfff76d6dd41005d0dd534e0bd97641019d /lib
parentlocking/rtmutex: Don't initialize lockdep when not required (diff)
parentMerge branch 'for-linus' of git://git.kernel.dk/linux-block (diff)
downloadwireguard-linux-f9e169883164390a15b56d00cb7e22c2e72f4dba.tar.xz
wireguard-linux-f9e169883164390a15b56d00cb7e22c2e72f4dba.zip
Merge branch 'linus' into locking/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);