Bug 43871 - process.c:280: pointer troubles
process.c:280: pointer troubles
Status: RESOLVED CODE_FIX
Product: Platform Specific/Hardware
Classification: Unclassified
Component: Other
All Linux
: P1 normal
Assigned To: platform_other
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-06-26 20:43 UTC by David Binderman
Modified: 2012-08-15 21:59 UTC (History)
2 users (show)

See Also:
Kernel Version: 3.5-rc3
Tree: Mainline
Regression: No


Attachments

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

Note You need to log in before you can comment on or make changes to this bug.