[PATCH] x86/fpu: remove unnecessary curfps null pointer check

Liu Chao posted 1 patch 2 months, 2 weeks ago
arch/x86/kernel/fpu/xstate.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[PATCH] x86/fpu: remove unnecessary curfps null pointer check
Posted by Liu Chao 2 months, 2 weeks ago
curfps has been dereferenced before check and cann't be NULL.

Signed-off-by: Liu Chao <liuchao173@huawei.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