summaryrefslogtreecommitdiff
path: root/drivers/net/ethernet/ti
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@linaro.org>2024-10-16 17:41:44 +0300
committerAndrew Lunn <andrew@lunn.ch>2024-10-18 02:01:36 +0300
commitff1d3484d6d29dda92421b9a753e4ca54f91aa8a (patch)
treecdc3584e29af13cb4e253c894a320835ac422f67 /drivers/net/ethernet/ti
parentf87a17ed3b51fba4dfdd8f8b643b5423a85fc551 (diff)
downloadlinux-ff1d3484d6d29dda92421b9a753e4ca54f91aa8a.tar.xz
net: ethernet: ti: am65-cpsw: Fix uninitialized variable
The *ndev pointer needs to be set or it leads to an uninitialized variable bug in the caller. Fixes: 4a7b2ba94a59 ("net: ethernet: ti: am65-cpsw: Use tstats instead of open coded version") Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org> Reviewed-by: Roger Quadros <rogerq@kernel.org> Message-ID: <b168d5c7-704b-4452-84f9-1c1762b1f4ce@stanley.mountain> Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Diffstat (limited to 'drivers/net/ethernet/ti')
-rw-r--r--drivers/net/ethernet/ti/am65-cpsw-nuss.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/net/ethernet/ti/am65-cpsw-nuss.c b/drivers/net/ethernet/ti/am65-cpsw-nuss.c
index acaf06b274ca..6201a09fa5f0 100644
--- a/drivers/net/ethernet/ti/am65-cpsw-nuss.c
+++ b/drivers/net/ethernet/ti/am65-cpsw-nuss.c
@@ -1341,6 +1341,7 @@ am65_cpsw_nuss_tx_compl_packet_xdp(struct am65_cpsw_common *common,
port = am65_common_get_port(common, port_id);
dev_sw_netstats_tx_add(port->ndev, 1, xdpf->len);
+ *ndev = port->ndev;
return xdpf;
}