public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] arm64/sme: Fix NULL check after kzalloc
@ 2022-04-26 11:30 Wan Jiabing
  2022-04-26 11:45 ` Mark Brown
  2022-04-29 19:20 ` Catalin Marinas
  0 siblings, 2 replies; 3+ messages in thread
From: Wan Jiabing @ 2022-04-26 11:30 UTC (permalink / raw)
  To: Catalin Marinas, Will Deacon, Mark Brown, Mark Rutland,
	Marc Zyngier, Madhavan T. Venkataraman, D Scott Phillips,
	linux-arm-kernel, linux-kernel
  Cc: Wan Jiabing

Fix following coccicheck error:
./arch/arm64/kernel/process.c:322:2-23: alloc with no test, possible model on line 326

Here should be dst->thread.sve_state.

Fixes: 8bd7f91c03d8 ("arm64/sme: Implement traps and syscall handling for SME")
Signed-off-by: Wan Jiabing <wanjiabing@vivo.com>
---
 arch/arm64/kernel/process.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm64/kernel/process.c b/arch/arm64/kernel/process.c
index 99c293513817..9734c9fb1a32 100644
--- a/arch/arm64/kernel/process.c
+++ b/arch/arm64/kernel/process.c
@@ -321,7 +321,7 @@ int arch_dup_task_struct(struct task_struct *dst, struct task_struct *src)
 	if (thread_za_enabled(&src->thread)) {
 		dst->thread.sve_state = kzalloc(sve_state_size(src),
 						GFP_KERNEL);
-		if (!dst->thread.za_state)
+		if (!dst->thread.sve_state)
 			return -ENOMEM;
 		dst->thread.za_state = kmemdup(src->thread.za_state,
 					       za_state_size(src),
-- 
2.35.3


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-04-29 19:20 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-04-26 11:30 [PATCH] arm64/sme: Fix NULL check after kzalloc Wan Jiabing
2022-04-26 11:45 ` Mark Brown
2022-04-29 19:20 ` Catalin Marinas

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox