lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <f9312e29-ebc0-8567-20a3-9e0f6f0807d3@gmail.com>
Date:   Mon, 24 Sep 2018 16:50:19 -0700
From:   Florian Fainelli <f.fainelli@...il.com>
To:     Andrew Lunn <andrew@...n.ch>
Cc:     David Miller <davem@...emloft.net>,
        netdev <netdev@...r.kernel.org>,
        Russell King <rmk+kernel@....linux.org.uk>
Subject: Re: [PATCH net] net: phy: sfp: Fix unregistering of HWMON SFP device

On 09/24/2018 04:46 PM, Andrew Lunn wrote:
> On Mon, Sep 24, 2018 at 03:43:33PM -0700, Florian Fainelli wrote:
>> On 09/24/2018 03:38 PM, Andrew Lunn wrote:
>>> 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@...il.com>
>>> Fixes: 1323061a018a ("net: phy: sfp: Add HWMON support for module sensors")
>>> Signed-off-by: Andrew Lunn <andrew@...n.ch>
>>> ---
>>>  drivers/net/phy/sfp.c | 7 +++++--
>>>  1 file changed, 5 insertions(+), 2 deletions(-)
>>>
>>> diff --git a/drivers/net/phy/sfp.c b/drivers/net/phy/sfp.c
>>> index 52fffb98fde9..23705ffae6bb 100644
>>> --- a/drivers/net/phy/sfp.c
>>> +++ b/drivers/net/phy/sfp.c
>>> @@ -1098,8 +1098,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 (!PTR_ERR_OR_NULL(sfp->hwmon_dev)) {
>>
>> I believe this should be IS_ERR_OR_NULL(), there is no PTR_ERR_OR_NULL()
>> in the Linux tree AFAICT.
> 
> Yep.
> 
> Please ignore this patch.

After fixing this locally, this worked, feel free to add a

Tested-by: Florian Fainelli <f.fainelli@...il.com>

to your v2. Thanks for the fix!
-- 
Florian

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ