Skip to content

Commit 2e29b99

Browse files
Wan Jiabingctmarinas
authored andcommitted
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: 8bd7f91 ("arm64/sme: Implement traps and syscall handling for SME") Signed-off-by: Wan Jiabing <wanjiabing@vivo.com> Reviwed-by: Mark Brown <broonie@kernel.org> Link: https://lore.kernel.org/r/20220426113054.630983-1-wanjiabing@vivo.com Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
1 parent 8a58bcd commit 2e29b99

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

arch/arm64/kernel/process.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@ int arch_dup_task_struct(struct task_struct *dst, struct task_struct *src)
321321
if (thread_za_enabled(&src->thread)) {
322322
dst->thread.sve_state = kzalloc(sve_state_size(src),
323323
GFP_KERNEL);
324-
if (!dst->thread.za_state)
324+
if (!dst->thread.sve_state)
325325
return -ENOMEM;
326326
dst->thread.za_state = kmemdup(src->thread.za_state,
327327
za_state_size(src),

0 commit comments

Comments
 (0)