Commit 8466d39
net: usbnet: Fix the wrong netif_carrier_on() call
The commit referenced in the Fixes tag causes usbnet to malfunction
(identified via git bisect). Post-commit, my external RJ45 LAN cable
fails to connect. Linus also reported the same issue after pulling that
commit.
The code has a logic error: netif_carrier_on() is only called when the
link is already on. Fix this by moving the netif_carrier_on() call
outside the if-statement entirely. This ensures it is always called
when EVENT_LINK_CARRIER_ON is set and properly clears it regardless
of the link state.
Cc: [email protected]
Cc: Armando Budianto <[email protected]>
Reviewed-by: Simon Horman <[email protected]>
Suggested-by: Linus Torvalds <[email protected]>
Link: https://lore.kernel.org/all/CAHk-=wjqL4uF0MG_c8+xHX1Vv8==sPYQrtzbdA3kzi96284nuQ@mail.gmail.com
Closes: https://lore.kernel.org/netdev/CAHk-=wjKh8X4PT_mU1kD4GQrbjivMfPn-_hXa6han_BTDcXddw@mail.gmail.com
Closes: https://lore.kernel.org/netdev/[email protected]
Fixes: 0d9cfc9 ("net: usbnet: Avoid potential RCU stall on LINK_CHANGE event")
Signed-off-by: Ammar Faizi <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>1 parent 6bcdbd6 commit 8466d39
1 file changed
Lines changed: 3 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1120 | 1120 | | |
1121 | 1121 | | |
1122 | 1122 | | |
| 1123 | + | |
| 1124 | + | |
| 1125 | + | |
1123 | 1126 | | |
1124 | 1127 | | |
1125 | 1128 | | |
| |||
1129 | 1132 | | |
1130 | 1133 | | |
1131 | 1134 | | |
1132 | | - | |
1133 | | - | |
1134 | | - | |
1135 | 1135 | | |
1136 | 1136 | | |
1137 | 1137 | | |
| |||
0 commit comments