[v2] powerpc/ptrace: Fix cppcheck issue in gpr32_set_common/gpr32_get_common()

Michael Ellerman patch-notifications at ellerman.id.au
Tue Sep 13 22:16:36 AEST 2016


On Sun, 2016-11-09 at 13:44:13 UTC, Simon Guo wrote:
> From: Simon Guo <wei.guo.simon at gmail.com>
> 
> The ckpt_regs usage in gpr32_set_common/gpr32_get_common() will lead to
> following cppcheck error at ifndef CONFIG_PPC_TRANSACTIONAL_MEM case:
> 
> [arch/powerpc/kernel/ptrace.c:2062]:
> (error) Uninitialized variable: ckpt_regs
> [arch/powerpc/kernel/ptrace.c:2130]:
> (error) Uninitialized variable: ckpt_regs
> 
> The problem is due to gpr32_set_common() used ckpt_regs variable which
> only makes sense at #ifdef CONFIG_PPC_TRANSACTIONAL_MEM.
> 
> This patch fix this issue by passing in "regs" parameter instead.
> 
> Reported-by: Daniel Axtens <dja at axtens.net>
> Signed-off-by: Simon Guo <wei.guo.simon at gmail.com>

Applied to powerpc next, thanks.

https://git.kernel.org/powerpc/c/261831160d4df6bafe2f0e12e6

cheers


More information about the Linuxppc-dev mailing list