]> git.baikalelectronics.ru Git - kernel.git/commit
net: dsa: call teardown method on probe failure
authorVladimir Oltean <vladimir.oltean@nxp.com>
Thu, 4 Feb 2021 16:33:51 +0000 (18:33 +0200)
committerJakub Kicinski <kuba@kernel.org>
Fri, 5 Feb 2021 04:22:00 +0000 (20:22 -0800)
commitc4f0aecc4334b12c7df4ba4c004fea112ded6292
treeacfaafe203d44286c9be0a1c86e0b1177e4528ce
parent40137ed3919c70d71c7c4dab2358463d43d46c6d
net: dsa: call teardown method on probe failure

Since teardown is supposed to undo the effects of the setup method, it
should be called in the error path for dsa_switch_setup, not just in
dsa_switch_teardown.

Fixes: a01c5b7bc76b ("net: dsa: Add teardown callback for drivers")
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Link: https://lore.kernel.org/r/20210204163351.2929670-1-vladimir.oltean@nxp.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/dsa/dsa2.c