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] [day] [month] [year] [list]
Message-ID: <53804985.7030204@gmail.com>
Date:	Sat, 24 May 2014 09:25:57 +0200
From:	Daniel Mack <zonque@...il.com>
To:	Florian Fainelli <f.fainelli@...il.com>
CC:	netdev <netdev@...r.kernel.org>,
	David Miller <davem@...emloft.net>,
	mugunthanvnm <mugunthanvnm@...com>,
	Matus Ujhelyi <ujhelyi.m@...il.com>
Subject: Re: [PATCH 2/3] net: of_mdio: add of_mdiobus_link_phydev()

On 05/23/2014 09:35 PM, Florian Fainelli wrote:
> 2014-05-10 9:37 GMT-07:00 Daniel Mack <zonque@...il.com>:

>> +/**
>> + * of_mdiobus_link_phydev - Find a device node for a phy
>> + * @mdio: pointer to mii_bus structure
>> + * @phydev: phydev for which the of_node pointer should be set
>> + *
>> + * Walk the list of subnodes of a mdio bus and look for a node that matches the
>> + * phy's address with its 'reg' property. If found, set the of_node pointer for
>> + * the phy. This allows auto-probed pyh devices to be supplied with information
>> + * passed in via DT.
>> + */
>> +void of_mdiobus_link_phydev(struct mii_bus *mdio,
>> +                           struct phy_device *phydev)
>> +{
>> +       struct device *dev = &phydev->dev;
>> +       struct device_node *child;
>> +
>> +       if (dev->of_node)
>> +               return;
> 
> This should be:
> 
>             if (dev->of_node || !mdio->dev_of_node)
>                     return;
> 
> a system with for instance non-DT probed MDIO busses such as the
> special fixed MDIO bus will not have such an of_node pointer and we
> will have a null pointer during the first iteration of the for_each_*
> loop.
> 
> arguably of_get_next_available_child() could be updated to handle a
> NULL parent device_node, but I think it clearer to add this check
> here.

Good catch! I'll change that, add your Reviewed-by and resend!


Thanks,
Daniel

--
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

Powered by Openwall GNU/*/Linux Powered by OpenVZ