Skip to content

{bp-19411} drivers/net/w5500: fix wrong variable and d_private assignment - #19612

Merged
xiaoxiang781216 merged 1 commit into
apache:releases/13.0from
jerpelea:bp-19411
Aug 3, 2026
Merged

{bp-19411} drivers/net/w5500: fix wrong variable and d_private assignment#19612
xiaoxiang781216 merged 1 commit into
apache:releases/13.0from
jerpelea:bp-19411

Conversation

@jerpelea

@jerpelea jerpelea commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Summary

Fix two latent defects in the W5500 Ethernet driver:

  1. NETDEV_RXERRORS() references non-existent variables (line 1351): In w5500_receive(), the error path uses &priv->dev but the function parameter is named self and the device field is w_dev. This compiles only because NETDEV_RXERRORS() expands to nothing without CONFIG_NETDEV_STATISTICS; enabling statistics breaks the build.

  2. d_private set to the device array instead of the instance (line 2069): In w5500_initialize(), d_private was set to g_w5500 (the global array) instead of self (the current instance). This is harmless for device 0 (g_w5500 == &g_w5500[0]) but wrong for any devno > 0 — every callback that recovers the driver state via dev->d_private would operate on device 0's state.

Fixes #19306

Impact

RELEASE

Testing

CI

Fix two latent defects in the W5500 Ethernet driver:

1. NETDEV_RXERRORS() references non-existent variables (line 1351):
   In w5500_receive(), the error path uses &priv->dev but the function
   parameter is named self and the device field is w_dev. This compiles
   only because NETDEV_RXERRORS() expands to nothing without
   CONFIG_NETDEV_STATISTICS; enabling statistics breaks the build.

2. d_private set to the device array instead of the instance (line 2069):
   In w5500_initialize(), d_private was set to g_w5500 (the global array)
   instead of self (the current instance). This is harmless for device 0
   (g_w5500 == &g_w5500[0]) but wrong for any devno > 0 — every callback
   that recovers the driver state via dev->d_private would operate on
   device 0's state.

Fixes apache#19306

Signed-off-by: hanzhijian <hanzhijian@zepp.com>
Author: hanzhijian <hanzhijian@zepp.com>
@github-actions github-actions Bot added Area: Networking Effects networking subsystem Size: XS The size of the change in this PR is very small labels Aug 3, 2026
@xiaoxiang781216
xiaoxiang781216 merged commit 20072dc into apache:releases/13.0 Aug 3, 2026
16 of 41 checks passed
@jerpelea
jerpelea deleted the bp-19411 branch August 3, 2026 11:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area: Networking Effects networking subsystem Size: XS The size of the change in this PR is very small

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants