Commit 2e29b997 authored by Wan Jiabing's avatar Wan Jiabing Committed by Catalin Marinas

arm64/sme: Fix NULL check after kzalloc

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: 8bd7f91c ("arm64/sme: Implement traps and syscall handling for SME")
Signed-off-by: default avatarWan Jiabing <wanjiabing@vivo.com>
Reviwed-by: default avatarMark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20220426113054.630983-1-wanjiabing@vivo.comSigned-off-by: default avatarCatalin Marinas <catalin.marinas@arm.com>
parent 8a58bcd0
...@@ -321,7 +321,7 @@ int arch_dup_task_struct(struct task_struct *dst, struct task_struct *src) ...@@ -321,7 +321,7 @@ int arch_dup_task_struct(struct task_struct *dst, struct task_struct *src)
if (thread_za_enabled(&src->thread)) { if (thread_za_enabled(&src->thread)) {
dst->thread.sve_state = kzalloc(sve_state_size(src), dst->thread.sve_state = kzalloc(sve_state_size(src),
GFP_KERNEL); GFP_KERNEL);
if (!dst->thread.za_state) if (!dst->thread.sve_state)
return -ENOMEM; return -ENOMEM;
dst->thread.za_state = kmemdup(src->thread.za_state, dst->thread.za_state = kmemdup(src->thread.za_state,
za_state_size(src), za_state_size(src),
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment