diff mbox series

[net-next] net: ethernet: ti: am65-cpsw: Fix uninitialized variable

Message ID b168d5c7-704b-4452-84f9-1c1762b1f4ce@stanley.mountain (mailing list archive)
State Accepted
Commit ff1d3484d6d29dda92421b9a753e4ca54f91aa8a
Delegated to: Netdev Maintainers
Headers show
Series [net-next] net: ethernet: ti: am65-cpsw: Fix uninitialized variable | expand

Checks

Context Check Description
netdev/series_format success Single patches do not need cover letters
netdev/tree_selection success Clearly marked for net-next
netdev/ynl success Generated files up to date; no warnings/errors; no diff in generated;
netdev/fixes_present success Fixes tag not required for -next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 5 this patch: 5
netdev/build_tools success No tools touched, skip
netdev/cc_maintainers success CCed 7 of 7 maintainers
netdev/build_clang success Errors and warnings before: 3 this patch: 3
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success Fixes tag looks correct
netdev/build_allmodconfig_warn success Errors and warnings before: 3 this patch: 3
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 7 lines checked
netdev/build_clang_rust success No Rust files in patch. Skipping build
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0
netdev/contest success net-next-2024-10-17--00-00 (tests: 776)

Commit Message

Dan Carpenter Oct. 16, 2024, 2:41 p.m. UTC
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>
---
 drivers/net/ethernet/ti/am65-cpsw-nuss.c | 1 +
 1 files changed, 1 insertion(+)

Comments

Roger Quadros Oct. 16, 2024, 6:57 p.m. UTC | #1
On 16/10/2024 17:41, Dan Carpenter wrote:
> 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>

Thanks Dan for this fix!

Reviewed-by: Roger Quadros <rogerq@kernel.org>
patchwork-bot+netdevbpf@kernel.org Oct. 17, 2024, 11:10 p.m. UTC | #2
Hello:

This patch was applied to netdev/net-next.git (main)
by Andrew Lunn <andrew@lunn.ch>:

On Wed, 16 Oct 2024 17:41:44 +0300 you wrote:
> 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>
> ---
>  drivers/net/ethernet/ti/am65-cpsw-nuss.c | 1 +
>  1 files changed, 1 insertion(+)

Here is the summary with links:
  - [net-next] net: ethernet: ti: am65-cpsw: Fix uninitialized variable
    https://git.kernel.org/netdev/net-next/c/ff1d3484d6d2

You are awesome, thank you!
diff mbox series

Patch

diff --git a/drivers/net/ethernet/ti/am65-cpsw-nuss.c b/drivers/net/ethernet/ti/am65-cpsw-nuss.c
index cda7ddfe6845..fe1f2fa0ff9c 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;
 }