From: Andrew Goodbody Date: Mon, 4 Aug 2025 16:56:59 +0000 (+0100) Subject: net: fsl-mc: Incorrect variable used in error path X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=05b11146363039a00bff09c77be077ebdaf1f5d0;p=thirdparty%2Fu-boot.git net: fsl-mc: Incorrect variable used in error path In mc_fixup_dpc_mac_addr noff is assigned the return value from fdt_add_subnode so that is the variable that should be passed to fdt_strerror and returned when negative. This issue was found by Smatch. Signed-off-by: Andrew Goodbody Signed-off-by: Peng Fan --- diff --git a/drivers/net/fsl-mc/mc.c b/drivers/net/fsl-mc/mc.c index aad852f8151..c8ed702f50a 100644 --- a/drivers/net/fsl-mc/mc.c +++ b/drivers/net/fsl-mc/mc.c @@ -366,8 +366,8 @@ static int mc_fixup_dpc_mac_addr(void *blob, int dpmac_id, noff = fdt_add_subnode(blob, nodeoffset, mac_name); if (noff < 0) { printf("fdt_add_subnode: err=%s\n", - fdt_strerror(err)); - return err; + fdt_strerror(noff)); + return noff; } /* add default property of fixed link */