X-Git-Url: https://git.karo-electronics.de/?a=blobdiff_plain;f=lib%2Flibcrc32c.c;h=9f79547d1b9782237a563f6a2e838655f6adf6dc;hb=330e9e46253cbfab178450c976aa90ef0f3ae940;hp=74a54b7f25626e8c6d224af2b7384f7dcbf2e72f;hpb=b8155fe1b2963ab2c53140929eb2362afcb9ccfe;p=karo-tx-linux.git 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);