arch/xtensa/kernel/process.c: take size of pointed value, not pointer
Subsystems (2)
PATCH 4/4 arch/xtensa/kernel/process.c: take size of pointed value, not pointer
From: Julia Lawall <[email protected]>
Sizeof a pointer-typed expression returns the size of the pointer, not that of the pointed data.
The semantic patch that fixes this problem is as follows:
(http://coccinelle.lip6.fr/)
// <smpl>
@@
expression *e;
type T;
identifier f;
@@
f(...,(T)e,...,
-sizeof(e)
+sizeof(*e)
,...)
// </smpl>
Signed-off-by Julia Lawall <[email protected]>
--- arch/xtensa/kernel/process.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/xtensa/kernel/process.c +1 -1
@@ -277,7 +277,7 @@ void xtensa_elf_core_copy_regs (xtensa_g/* Don't leak any random bits. */ -memset (elfregs,0 ,sizeof (elfregs)); +memset (elfregs,0 ,sizeof (*elfregs));/* Note: PS.EXCM is not set while user task is running; its * being set in regs->ps is for exception handling convenience.