aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/netconsole.c
diff options
context:
space:
mode:
authorBreno Leitao <[email protected]>2024-08-22 11:10:47 +0000
committerJakub Kicinski <[email protected]>2024-08-26 16:25:44 +0000
commitae5a0456e0b4cfd7e61619e55251ffdf1bc7adfb (patch)
treef6ffe56e12f7d3b4579f858fa7f63d9af872d99a /drivers/net/netconsole.c
parentMerge branch 'adds-support-for-lan887x-phy' (diff)
downloadkernel-ae5a0456e0b4cfd7e61619e55251ffdf1bc7adfb.tar.gz
kernel-ae5a0456e0b4cfd7e61619e55251ffdf1bc7adfb.zip
netpoll: Ensure clean state on setup failures
Modify netpoll_setup() and __netpoll_setup() to ensure that the netpoll structure (np) is left in a clean state if setup fails for any reason. This prevents carrying over misconfigured fields in case of partial setup success. Key changes: - np->dev is now set only after successful setup, ensuring it's always NULL if netpoll is not configured or if netpoll_setup() fails. - np->local_ip is zeroed if netpoll setup doesn't complete successfully. - Added DEBUG_NET_WARN_ON_ONCE() checks to catch unexpected states. - Reordered some operations in __netpoll_setup() for better logical flow. These changes improve the reliability of netpoll configuration, since it assures that the structure is fully initialized or totally unset. Suggested-by: Paolo Abeni <[email protected]> Signed-off-by: Breno Leitao <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
Diffstat (limited to 'drivers/net/netconsole.c')
0 files changed, 0 insertions, 0 deletions