mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-30 06:10:56 +00:00
powerpc/kexec: Fix build failure from uninitialised variable
commit83ee9f2376
upstream. clang 14 won't build because ret is uninitialised and can be returned if both prop and fdtprop are NULL. Drop the ret variable and return an error in that failure case. Fixes:b1fc44eaa9
("pseries/iommu/ddw: Fix kdump to work in absence of ibm,dma-window") Suggested-by: Christophe Leroy <christophe.leroy@csgroup.eu> Signed-off-by: Russell Currey <ruscur@russell.cc> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Link: https://lore.kernel.org/r/20220810054331.373761-1-ruscur@russell.cc Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
2f49bfbba3
commit
ee57f8bba8
1 changed files with 5 additions and 5 deletions
|
@ -1043,17 +1043,17 @@ static int copy_property(void *fdt, int node_offset, const struct device_node *d
|
|||
const char *propname)
|
||||
{
|
||||
const void *prop, *fdtprop;
|
||||
int len = 0, fdtlen = 0, ret;
|
||||
int len = 0, fdtlen = 0;
|
||||
|
||||
prop = of_get_property(dn, propname, &len);
|
||||
fdtprop = fdt_getprop(fdt, node_offset, propname, &fdtlen);
|
||||
|
||||
if (fdtprop && !prop)
|
||||
ret = fdt_delprop(fdt, node_offset, propname);
|
||||
return fdt_delprop(fdt, node_offset, propname);
|
||||
else if (prop)
|
||||
ret = fdt_setprop(fdt, node_offset, propname, prop, len);
|
||||
|
||||
return ret;
|
||||
return fdt_setprop(fdt, node_offset, propname, prop, len);
|
||||
else
|
||||
return -FDT_ERR_NOTFOUND;
|
||||
}
|
||||
|
||||
static int update_pci_dma_nodes(void *fdt, const char *dmapropname)
|
||||
|
|
Loading…
Reference in a new issue