]> git.baikalelectronics.ru Git - kernel.git/commit
Net: DSA: Fix checking for get_phy_flags function
authorAndrew Lunn <andrew@lunn.ch>
Sun, 19 Oct 2014 14:41:47 +0000 (16:41 +0200)
committerDavid S. Miller <davem@davemloft.net>
Sun, 19 Oct 2014 16:46:31 +0000 (12:46 -0400)
commitb96e8029d0daee2a1e712f69b38f5a860b1254c5
tree0ade083774b11e5e3874a8b1c57d48d93792993a
parenteae563a6678d7302c410c7e177eb74de91c351ce
Net: DSA: Fix checking for get_phy_flags function

The check for the presence or not of the optional switch function
get_phy_flags() called the function, rather than checked to see if it
is a NULL pointer. This causes a derefernce of a NULL pointer on all
switch chips except the sf2, the only switch to implement this call.

Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Fixes: fafea7f03889 ("net: dsa: allow switch drivers to specify phy_device::dev_flags")
Cc: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/dsa/slave.c