From: Andrew Lunn <[email protected]> Date: Thu, 5 Apr 2018 01:56:44 +0200
> The Marvell switches under some conditions will pass a frame to the > host with the port being the CPU port. Such frames are invalid, and > should be dropped. Not dropping them can result in a crash when > incrementing the receive statistics for an invalid port. > > Reported-by: Chris Healy <[email protected]> > Fixes: 5f6b4e14cada ("net: dsa: User per-cpu 64-bit statistics") > Signed-off-by: Andrew Lunn <[email protected]> ... > + slave_port = &ds->ports[port]; > + > + if (slave_port->type != DSA_PORT_TYPE_USER) > + return NULL; Look like we need a Fixes: update and an adjustment to use unlikely() here based upon Florian's feedback.
