Skip to content

Commit

Permalink
powerpc/sstep: Avoid used uninitialized error
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
mpe committed Sep 1, 2017
1 parent fdbb945 commit 3b79b26
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions arch/powerpc/lib/sstep.c
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 3b79b26

Please sign in to comment.