From: Andrew Goodbody Date: Mon, 4 Aug 2025 15:11:37 +0000 (+0100) Subject: net: dwc_eth_xgmac: Use unwind goto on error X-Git-Tag: v2025.10-rc2~3^2~35 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7701cc3415db98d0b2cc56ef8601939615254a2b;p=pandora-u-boot.git net: dwc_eth_xgmac: Use unwind goto on error In xgmac_probe there is a direct return after the point where unwind gotos start to be used to undo actions performed by earlier code. Use the appropriate unwind goto instead. This issue was found by Smatch. Signed-off-by: Andrew Goodbody Reviewed-by: Tien Fong Chee --- diff --git a/drivers/net/dwc_eth_xgmac.c b/drivers/net/dwc_eth_xgmac.c index 03959ea95a5..d29d871ea8c 100644 --- a/drivers/net/dwc_eth_xgmac.c +++ b/drivers/net/dwc_eth_xgmac.c @@ -1102,7 +1102,7 @@ static int xgmac_probe(struct udevice *dev) ret = xgmac->config->ops->xgmac_start_clks(dev); if (ret < 0) { pr_err("%s xgmac_start_clks() failed: %d\n", dev->name, ret); - return ret; + goto err_remove_resources_core; } if (IS_ENABLED(CONFIG_DM_ETH_PHY))