]> git.baikalelectronics.ru Git - kernel.git/commit
net: dsa: Fix legacy probing
authorFlorian Fainelli <f.fainelli@gmail.com>
Fri, 16 Jun 2017 23:42:11 +0000 (16:42 -0700)
committerDavid S. Miller <davem@davemloft.net>
Sun, 18 Jun 2017 02:59:45 +0000 (22:59 -0400)
commitc22175d854b688df57b4476e1949d7e64d47d599
tree4ff3a224dd92c8c4ea757dea32c16c10056909e2
parent4e44f5db783e50555f432b4167df02a1381cfb46
net: dsa: Fix legacy probing

After commit 0daa7a7ea6f1 ("net: dsa: Remove master_netdev and
use dst->cpu_dp->netdev") and fda7c92e4eec ("net: dsa: Associate
slave network device with CPU port") we would be seeing NULL pointer
dereferences when accessing dst->cpu_dp->netdev too early. In the legacy
code, we actually know early in advance the master network device, so
pass it down to the relevant functions.

Fixes: 0daa7a7ea6f1 ("net: dsa: Remove master_netdev and use dst->cpu_dp->netdev")
Fixes: fda7c92e4eec ("net: dsa: Associate slave network device with CPU port")
Reported-by: Jason Cobham <jcobham@questertangent.com>
Tested-by: Jason Cobham <jcobham@questertangent.com>
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Reviewed-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/dsa/legacy.c