Bug 43871

Summary: process.c:280: pointer troubles
Product: Platform Specific/Hardware Reporter: David Binderman (dcb314)
Component: OtherAssignee: platform_other
Status: RESOLVED CODE_FIX    
Severity: normal CC: alan, florian
Priority: P1    
Hardware: All   
OS: Linux   
Kernel Version: 3.5-rc3 Tree: Mainline
Regression: No

Description David Binderman 2012-06-26 20:43:01 UTC
I just ran the cppcheck static analysis tool over the source code
of the Linux kernel. It said

[linux-3.5-rc3/arch/xtensa/kernel/process.c:280]: (warning, inconclusive) Using size of pointer elfregs instead of size of its data.

The source code is

    memset(elfregs, 0, sizeof (elfregs));

Suggest

    memset(elfregs, 0, sizeof (*elfregs));

might be better code.
Comment 1 Florian Mickler 2012-07-25 19:37:01 UTC
A patch referencing this bug report has been merged in Linux v3.5-rc7:

commit 688bb4158f64f3af0fe1d13e7642f8c4c402453e
Author: Alan Cox <alan@linux.intel.com>
Date:   Wed Jul 11 14:02:50 2012 -0700

    xtensa: fix incorrect memset