diff options
| author | 2018-10-18 11:13:01 -0300 | |
|---|---|---|
| committer | 2018-10-18 11:13:01 -0300 | |
| commit | ce6c9da1113ad681bff27a3e376d2017f7f8a59c (patch) | |
| tree | 922ee99522f8e47e4fa5c735d4ea378dfdb79085 /drivers/net/phy/sfp.c | |
| parent | perf/x86/intel: Export mem events only if there's PEBS support (diff) | |
| parent | Merge tag 'perf-urgent-for-mingo-4.19-20181017' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/urgent (diff) | |
| download | wireguard-linux-ce6c9da1113ad681bff27a3e376d2017f7f8a59c.tar.xz wireguard-linux-ce6c9da1113ad681bff27a3e376d2017f7f8a59c.zip | |
Merge remote-tracking branch 'tip/perf/urgent' into perf/core
To pick up fixes.
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'drivers/net/phy/sfp.c')
| -rw-r--r-- | drivers/net/phy/sfp.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/net/phy/sfp.c b/drivers/net/phy/sfp.c index 52fffb98fde9..fd8bb998ae52 100644 --- a/drivers/net/phy/sfp.c +++ b/drivers/net/phy/sfp.c @@ -163,8 +163,6 @@ static const enum gpiod_flags gpio_flags[] = { /* Give this long for the PHY to reset. */ #define T_PHY_RESET_MS 50 -static DEFINE_MUTEX(sfp_mutex); - struct sff_data { unsigned int gpios; bool (*module_supported)(const struct sfp_eeprom_id *id); @@ -1098,8 +1096,11 @@ static int sfp_hwmon_insert(struct sfp *sfp) static void sfp_hwmon_remove(struct sfp *sfp) { - hwmon_device_unregister(sfp->hwmon_dev); - kfree(sfp->hwmon_name); + if (!IS_ERR_OR_NULL(sfp->hwmon_dev)) { + hwmon_device_unregister(sfp->hwmon_dev); + sfp->hwmon_dev = NULL; + kfree(sfp->hwmon_name); + } } #else static int sfp_hwmon_insert(struct sfp *sfp) |
