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]
Date:   Mon, 21 Sep 2020 21:08:12 -0400
From:   Alan Stern <stern@...land.harvard.edu>
To:     Matthias Kaehlcke <mka@...omium.org>
Cc:     Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        Rob Herring <robh+dt@...nel.org>,
        Frank Rowand <frowand.list@...il.com>,
        linux-kernel@...r.kernel.org,
        Douglas Anderson <dianders@...omium.org>,
        linux-usb@...r.kernel.org, Bastien Nocera <hadess@...ess.net>,
        Krzysztof Kozlowski <krzk@...nel.org>,
        devicetree@...r.kernel.org,
        Ravi Chandra Sadineni <ravisadineni@...omium.org>,
        Peter Chen <peter.chen@....com>,
        Stephen Boyd <swboyd@...omium.org>,
        "Alexander A. Klimov" <grandmaster@...klimov.de>,
        Masahiro Yamada <masahiroy@...nel.org>
Subject: Re: [PATCH v2 2/2] USB: misc: Add onboard_usb_hub driver

On Mon, Sep 21, 2020 at 05:41:58PM -0700, Matthias Kaehlcke wrote:
> > > +	put_device(hub->dev);
> > 
> > Is there a matching get_device somewhere (like in _find_onboard_hub)?
> > If so, I didn't see it.  And I don't see any reason for it.
> 
> Yes, implicitly, of_find_device_by_node() "takes a reference to the
> embedded struct device which needs to be dropped after use."

Okay.  In that case it probably would be better to do the put_device()
right away, at the end of _find_onboard_hub().

There would be no danger of the platform device getting freed too soon 
if you make onboard_hub_remove unbind the associated USB hub devices.  
But there would still be a danger of those devices somehow getting 
rebound again at the wrong time; this suggests that you should add a 
flag to the onboard_hub structure saying that the platform device is 
about to go away.

Alan Stern

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ