Skip to content

Commit 83ee9f2

Browse files
ruscurmpe
authored andcommitted
powerpc/kexec: Fix build failure from uninitialised variable
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: b1fc44e ("pseries/iommu/ddw: Fix kdump to work in absence of ibm,dma-window") Suggested-by: Christophe Leroy <[email protected]> Signed-off-by: Russell Currey <[email protected]> Signed-off-by: Michael Ellerman <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 59bab33 commit 83ee9f2

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

arch/powerpc/kexec/file_load_64.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1043,17 +1043,17 @@ static int copy_property(void *fdt, int node_offset, const struct device_node *d
10431043
const char *propname)
10441044
{
10451045
const void *prop, *fdtprop;
1046-
int len = 0, fdtlen = 0, ret;
1046+
int len = 0, fdtlen = 0;
10471047

10481048
prop = of_get_property(dn, propname, &len);
10491049
fdtprop = fdt_getprop(fdt, node_offset, propname, &fdtlen);
10501050

10511051
if (fdtprop && !prop)
1052-
ret = fdt_delprop(fdt, node_offset, propname);
1052+
return fdt_delprop(fdt, node_offset, propname);
10531053
else if (prop)
1054-
ret = fdt_setprop(fdt, node_offset, propname, prop, len);
1055-
1056-
return ret;
1054+
return fdt_setprop(fdt, node_offset, propname, prop, len);
1055+
else
1056+
return -FDT_ERR_NOTFOUND;
10571057
}
10581058

10591059
static int update_pci_dma_nodes(void *fdt, const char *dmapropname)

0 commit comments

Comments
 (0)