[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20250718092020.1619436-1-liuchao173@huawei.com>
Date: Fri, 18 Jul 2025 17:20:20 +0800
From: Liu Chao <liuchao173@...wei.com>
To: <linux-kernel@...r.kernel.org>
CC: <tglx@...utronix.de>, <mingo@...hat.com>, <bp@...en8.de>,
<hewenliang4@...wei.com>
Subject: [PATCH] x86/fpu: remove unnecessary curfps null pointer check
curfps has been dereferenced before check and cann't be NULL.
Signed-off-by: Liu Chao <liuchao173@...wei.com>
---
arch/x86/kernel/fpu/xstate.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/x86/kernel/fpu/xstate.c b/arch/x86/kernel/fpu/xstate.c
index cded076469fa..0e299af49ac9 100644
--- a/arch/x86/kernel/fpu/xstate.c
+++ b/arch/x86/kernel/fpu/xstate.c
@@ -1501,7 +1501,7 @@ static int fpstate_realloc(u64 xfeatures, unsigned int ksize,
fpregs_unlock();
/* Only free valloc'ed state */
- if (curfps && curfps->is_valloc)
+ if (curfps->is_valloc)
vfree(curfps);
return 0;
--
2.23.0
Powered by blists - more mailing lists