* [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* Re: [PATCH] arm64/sme: Fix NULL check after kzalloc
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
1 sibling, 0 replies; 3+ messages in thread
From: Mark Brown @ 2022-04-26 11:45 UTC (permalink / raw)
To: Wan Jiabing
Cc: Catalin Marinas, Will Deacon, Mark Rutland, Marc Zyngier,
Madhavan T. Venkataraman, D Scott Phillips, linux-arm-kernel,
linux-kernel
[-- Attachment #1: Type: text/plain, Size: 279 bytes --]
On Tue, Apr 26, 2022 at 07:30:53PM +0800, Wan Jiabing wrote:
> 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.
Reviwed-by: Mark Brown <broonie@kernel.org>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] arm64/sme: Fix NULL check after kzalloc
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
1 sibling, 0 replies; 3+ messages in thread
From: Catalin Marinas @ 2022-04-29 19:20 UTC (permalink / raw)
To: Mark Brown, Mark Rutland, linux-arm-kernel, Will Deacon,
D Scott Phillips, linux-kernel, Madhavan T. Venkataraman,
Marc Zyngier, Wan Jiabing
On Tue, 26 Apr 2022 19:30:53 +0800, Wan Jiabing wrote:
> 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.
>
>
Applied to arm64 (for-next/sme), thanks!
[1/1] arm64/sme: Fix NULL check after kzalloc
https://git.kernel.org/arm64/c/2e29b9971ac5
--
Catalin
^ permalink raw reply [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