]> www.infradead.org Git - users/jedix/linux-maple.git/commit
powerpc: Always initialize input array when calling epapr_hypercall()
authorSeth Forshee <seth.forshee@canonical.com>
Thu, 28 Sep 2017 13:33:39 +0000 (09:33 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 5 Mar 2019 16:58:02 +0000 (17:58 +0100)
commit32f31fa571083841f07bed67e46d0c5c5369b549
tree750896f615a34f65978447add1ca20418eb4c7d1
parent7ce9d889aa00d88dacf9a88a293cea555a148a7f
powerpc: Always initialize input array when calling epapr_hypercall()

commit 186b8f1587c79c2fa04bfa392fdf084443e398c1 upstream.

Several callers to epapr_hypercall() pass an uninitialized stack
allocated array for the input arguments, presumably because they
have no input arguments. However this can produce errors like
this one

 arch/powerpc/include/asm/epapr_hcalls.h:470:42: error: 'in' may be used uninitialized in this function [-Werror=maybe-uninitialized]
  unsigned long register r3 asm("r3") = in[0];
                                        ~~^~~

Fix callers to this function to always zero-initialize the input
arguments array to prevent this.

Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Cc: "A. Wilcox" <awilfox@adelielinux.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/powerpc/include/asm/epapr_hcalls.h