diff options
author | Mark Brown <broonie@kernel.org> | 2024-12-09 12:51:04 +0000 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2024-12-09 12:51:04 +0000 |
commit | e5fca61fdfcdd7d3cc43c0b4c3b959d4f2b06666 (patch) | |
tree | 50ba871eea4178efdf97f829b575c02a9140dd85 /net/core/link_watch.c | |
parent | 1a90aae3b25b72e639da6062e0dc5efb9cff58f1 (diff) | |
parent | fac04efc5c793dccbd07e2d59af9f90b7fc0dca4 (diff) |
spi: Merge up v6.12-rc2
This has fixes for several boards which help my testing a lot.
Diffstat (limited to 'net/core/link_watch.c')
-rw-r--r-- | net/core/link_watch.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/net/core/link_watch.c b/net/core/link_watch.c index ab150641142a..1b4d39e38084 100644 --- a/net/core/link_watch.c +++ b/net/core/link_watch.c @@ -45,9 +45,14 @@ static unsigned int default_operstate(const struct net_device *dev) int iflink = dev_get_iflink(dev); struct net_device *peer; - if (iflink == dev->ifindex) + /* If called from netdev_run_todo()/linkwatch_sync_dev(), + * dev_net(dev) can be already freed, and RTNL is not held. + */ + if (dev->reg_state == NETREG_UNREGISTERED || + iflink == dev->ifindex) return IF_OPER_DOWN; + ASSERT_RTNL(); peer = __dev_get_by_index(dev_net(dev), iflink); if (!peer) return IF_OPER_DOWN; |