diff options
author | Heiner Kallweit <hkallweit1@gmail.com> | 2018-09-18 21:55:36 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-09-19 21:06:46 -0700 |
commit | 124eee3f6955f7aa19b9e6ff5c9b6d37cb3d1e2c (patch) | |
tree | fb42d27e933440f5295eaace7a973b3e830011d1 /drivers/net/phy/phy.c | |
parent | Merge branch 'net-Use-FIELD_SIZEOF-directly-instead-of-reimplementing-its-function' (diff) | |
download | linux-dev-124eee3f6955f7aa19b9e6ff5c9b6d37cb3d1e2c.tar.xz linux-dev-124eee3f6955f7aa19b9e6ff5c9b6d37cb3d1e2c.zip |
net: linkwatch: add check for netdevice being present to linkwatch_do_dev
When bringing down the netdevice (incl. detaching it) and calling
netif_carrier_off directly or indirectly the latter triggers an
asynchronous linkwatch event.
This linkwatch event eventually may fail to access chip registers in
the ndo_get_stats/ndo_get_stats64 callback because the device isn't
accessible any longer, see call trace in [0].
To prevent this scenario don't check for IFF_UP only, but also make
sure that the netdevice is present.
[0] https://lists.openwall.net/netdev/2018/03/15/62
Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Tested-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/phy/phy.c')
0 files changed, 0 insertions, 0 deletions