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 PHC | |
Open Source and information security mailing list archives
| ||
|
Date: Wed, 23 Jul 2014 15:54:14 -0300 From: Ezequiel Garcia <ezequiel.garcia@...e-electrons.com> To: Florian Fainelli <f.fainelli@...il.com> Cc: netdev <netdev@...r.kernel.org>, David Miller <davem@...emloft.net>, Thomas Petazzoni <thomas.petazzoni@...e-electrons.com>, Gregory Clement <gregory.clement@...e-electrons.com> Subject: Re: [PATCH 2/2] net: phy: Ensure the MDIO bus module is held On 23 Jul 03:40 PM, Ezequiel Garcia wrote: > On 23 Jul 11:22 AM, Florian Fainelli wrote: > > 2014-07-22 17:16 GMT-07:00 Ezequiel Garcia <ezequiel.garcia@...e-electrons.com>: > > > @@ -614,10 +623,14 @@ int phy_attach_direct(struct net_device *dev, struct phy_device *phydev, > > > */ > > > err = phy_init_hw(phydev); > > > if (err) > > > - phy_detach(phydev); > > > - else > > > - phy_resume(phydev); > > > + goto err_module_put; > > > > > > + phy_resume(phydev); > > > + return err; > > > + > > > +err_module_put: > > > + module_put(bus_module); > > > + phy_detach(phydev); > > > > Since we are calling phy_detach() which is also attempting to do a > > module_put(), does not that result in one too many calls to > > module_put() on error path? > > > > As far as I can see all that module_get() and module_put() do > is increment and decrement refcounters. Therefore, I think you can > have as many module_{get,put}() calls as you want on a path. After reading this again, I know see what your pointing. The call to phy_detach already puts the module, so we don't need to do it on the error path above. I'll cook up v2. -- Ezequiel GarcĂa, Free Electrons Embedded Linux, Kernel and Android Engineering http://free-electrons.com -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@...r.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists