net: phy: set devices_in_package only after validation
authorRussell King <rmk+kernel@armlinux.org.uk>
Thu, 18 Jun 2020 13:46:03 +0000 (14:46 +0100)
committerDavid S. Miller <davem@davemloft.net>
Sat, 20 Jun 2020 03:17:15 +0000 (20:17 -0700)
commit5ba33cf4839266f059a6e2342c005709cc6cf256
treecb2631b4ca96565ee719aceb8809487982edbb34
parentc746053d275c8b6ff1d713addabf049c9c9a58fc
net: phy: set devices_in_package only after validation

Only set the devices_in_package to a non-zero value if we find a valid
value for this field, so we avoid leaving it set to e.g. 0x1fffffff.

Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/phy/phy_device.c