]> git.baikalelectronics.ru Git - kernel.git/commit
net: dsa: sja1105: register switch before assigning port private data
authorVivien Didelot <vivien.didelot@gmail.com>
Mon, 21 Oct 2019 20:51:28 +0000 (16:51 -0400)
committerJakub Kicinski <jakub.kicinski@netronome.com>
Tue, 22 Oct 2019 19:37:07 +0000 (12:37 -0700)
commit1b1c14866925073d162e34d8b05ce6496c0f2772
tree45c56f0c2f5482cee1dac26eb0364d02295ab841
parent8a93afb5be740cc70419686b430c2e3a64a915c6
net: dsa: sja1105: register switch before assigning port private data

Like the dsa_switch_tree structures, the dsa_port structures will be
allocated on switch registration.

The SJA1105 driver is the only one accessing the dsa_port structure
after the switch allocation and before the switch registration.
For that reason, move switch registration prior to assigning the priv
member of the dsa_port structures.

Signed-off-by: Vivien Didelot <vivien.didelot@gmail.com>
Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
drivers/net/dsa/sja1105/sja1105_main.c