]> git.baikalelectronics.ru Git - kernel.git/commit
net: dsa: microchip: Don't try to read stats for unused ports
authorRobert Hancock <hancock@sedsystems.ca>
Wed, 12 Jun 2019 20:33:32 +0000 (14:33 -0600)
committerDavid S. Miller <davem@davemloft.net>
Sat, 15 Jun 2019 02:10:03 +0000 (19:10 -0700)
commitce504529b9b72594d47249eb88f8aa3703c2d4c3
treef9edb2d3346b55ab3d528ab36349a76d1e4413ce
parent60b81c6ca62e3d582e8645abeafc58fa71a16adc
net: dsa: microchip: Don't try to read stats for unused ports

If some of the switch ports were not listed in the device tree, due to
being unused, the ksz_mib_read_work function ended up accessing a NULL
dp->slave pointer and causing an oops. Skip checking statistics for any
unused ports.

Fixes: d1e434e54ddb05e0 ("net: dsa: microchip: add MIB counter reading support")
Signed-off-by: Robert Hancock <hancock@sedsystems.ca>
Reviewed-by: Vivien Didelot <vivien.didelot@gmail.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/dsa/microchip/ksz_common.c