net: dsa: ocelot: felix: Remove requirement for PCS in felix devices
authorColin Foster <colin.foster@in-advantage.com>
Tue, 7 Dec 2021 17:00:28 +0000 (09:00 -0800)
committerJakub Kicinski <kuba@kernel.org>
Wed, 8 Dec 2021 05:44:49 +0000 (21:44 -0800)
commit49af6a7620c53b779572abfbfd7778e113154330
tree3cd935a8f9905f4975bb652b0cd8db4f6306b558
parentc99104840a95db04e5d71b0810d3666aaa5b2798
net: dsa: ocelot: felix: Remove requirement for PCS in felix devices

Existing felix devices all have an initialized pcs array. Future devices
might not, so running a NULL check on the array before dereferencing it
will allow those future drivers to not crash at this point

Signed-off-by: Colin Foster <colin.foster@in-advantage.com>
Reviewed-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/dsa/ocelot/felix.c