]> git.baikalelectronics.ru Git - kernel.git/commit
net: phy: sfp: Fix unregistering of HWMON SFP device
authorAndrew Lunn <andrew@lunn.ch>
Mon, 24 Sep 2018 23:50:00 +0000 (01:50 +0200)
committerDavid S. Miller <davem@davemloft.net>
Thu, 27 Sep 2018 03:23:31 +0000 (20:23 -0700)
commitea2b682d82627011f9c7c9b1d0cd4c72ff310d05
tree6b1bf48c256946ca775c9ab0e7f6d0c77da5401d
parentf533de18a01d5cb52c25b8ac2c9f5d994f0b79f0
net: phy: sfp: Fix unregistering of HWMON SFP device

A HWMON device is only registered is the SFP module supports the
diagnostic page and is complient to SFF8472. Don't unconditionally
unregister the hwmon device when the SFP module is remove, otherwise
we access data structures which don't exist.

Reported-by: Florian Fainelli <f.fainelli@gmail.com>
Fixes: d7f1b042f3e0 ("net: phy: sfp: Add HWMON support for module sensors")
Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Tested-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/phy/sfp.c