]> git.baikalelectronics.ru Git - kernel.git/commit
net: phy: check if advertising is zero using linkmode_empty
authorColin Ian King <colin.king@canonical.com>
Mon, 12 Nov 2018 23:45:56 +0000 (23:45 +0000)
committerDavid S. Miller <davem@davemloft.net>
Tue, 13 Nov 2018 00:26:21 +0000 (16:26 -0800)
commit833e9b0b4ad27d2d330e348f467cb772556636c2
tree210f62e76bac75f4f931dce4f63696f0bd75b1ce
parent1c05838d568a568189d2f60999871d41110d87ba
net: phy: check if advertising is zero using linkmode_empty

A recent change modified variable advertising from a u32 to a link mode
array and left the u32 zero comparison, so essential we now have an array
being compared to null which is not the intention. Fix this by using the
call to linkmode_empty to check if advertising is all zero.

Detected by CoverityScan, CID#1475424 ("Array compared against 0")

Fixes: b3e9409876df ("net: ethernet: Convert phydev advertize and supported from u32 to link mode")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/phy/phy.c