All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] powerpc/sstep: Avoid used uninitialized error
@ 2017-09-01 22:03 Michael Ellerman
  2017-09-06 10:55 ` Michael Ellerman
  0 siblings, 1 reply; 2+ messages in thread
From: Michael Ellerman @ 2017-09-01 22:03 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: paulus

Older compilers think val may be used uninitialized:

  arch/powerpc/lib/sstep.c: In function 'emulate_loadstore':
  arch/powerpc/lib/sstep.c:2758:23: error: 'val' may be used uninitialized in this function

We know better, but initialise val to 0 to avoid breaking the build.

Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
---
 arch/powerpc/lib/sstep.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/powerpc/lib/sstep.c b/arch/powerpc/lib/sstep.c
index 06dd61d8d48b..fb9f58b868e7 100644
--- a/arch/powerpc/lib/sstep.c
+++ b/arch/powerpc/lib/sstep.c
@@ -2727,6 +2727,7 @@ int emulate_loadstore(struct pt_regs *regs, struct instruction_op *op)
 		if (!address_ok(regs, ea, size))
 			return -EFAULT;
 		err = 0;
+		val = 0;
 		switch (size) {
 #ifdef __powerpc64__
 		case 1:
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: powerpc/sstep: Avoid used uninitialized error
  2017-09-01 22:03 [PATCH] powerpc/sstep: Avoid used uninitialized error Michael Ellerman
@ 2017-09-06 10:55 ` Michael Ellerman
  0 siblings, 0 replies; 2+ messages in thread
From: Michael Ellerman @ 2017-09-06 10:55 UTC (permalink / raw)
  To: Michael Ellerman, linuxppc-dev; +Cc: paulus

On Fri, 2017-09-01 at 22:03:44 UTC, Michael Ellerman wrote:
> Older compilers think val may be used uninitialized:
> 
>   arch/powerpc/lib/sstep.c: In function 'emulate_loadstore':
>   arch/powerpc/lib/sstep.c:2758:23: error: 'val' may be used uninitialized in this function
> 
> We know better, but initialise val to 0 to avoid breaking the build.
> 
> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>

Applied to powerpc next.

https://git.kernel.org/powerpc/c/3b79b26101936bbdb7a5c69161c69d

cheers

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-09-06 10:55 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-09-01 22:03 [PATCH] powerpc/sstep: Avoid used uninitialized error Michael Ellerman
2017-09-06 10:55 ` Michael Ellerman

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.