X-Git-Url: https://git.stricted.de/?a=blobdiff_plain;f=lib%2Flibcrc32c.c;h=9f79547d1b9782237a563f6a2e838655f6adf6dc;hb=53a7ff8fb785839b87f950fd85433d9c662fac89;hp=74a54b7f25626e8c6d224af2b7384f7dcbf2e72f;hpb=d66435cc7da95964cb386674bd82ec12ca66320a;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.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);