Blob Blame History Raw
From e09e3c038c853f9a332cf05a17e5fdee1c7837e0 Mon Sep 17 00:00:00 2001
From: Lianbo Jiang <lijiang@redhat.com>
Date: Thu, 18 Nov 2021 09:55:45 +0800
Subject: [PATCH] fix freepointer issue

Signed-off-by: Lianbo Jiang <lijiang@redhat.com>
---
 memory.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/memory.c b/memory.c
index a3cf8a86728d..81db9c7bee9f 100644
--- a/memory.c
+++ b/memory.c
@@ -19340,9 +19340,8 @@ freelist_ptr(struct meminfo *si, ulong ptr, ulong ptr_addr)
 	if (VALID_MEMBER(kmem_cache_random)) {
 		/* CONFIG_SLAB_FREELIST_HARDENED */
 
-		if (THIS_KERNEL_VERSION >= LINUX(5,7,0))
-			ptr_addr = (sizeof(long) == 8) ? bswap_64(ptr_addr)
-						       : bswap_32(ptr_addr);
+		ptr_addr = (sizeof(long) == 8) ? bswap_64(ptr_addr)
+					       : bswap_32(ptr_addr);
 		return (ptr ^ si->random ^ ptr_addr);
 	} else
 		return ptr;
-- 
2.30.2