]> git.baikalelectronics.ru Git - kernel.git/commit
net: dsa: sja1105: call dsa_unregister_switch when allocating memory fails
authorVladimir Oltean <vladimir.oltean@nxp.com>
Mon, 24 May 2021 09:25:23 +0000 (12:25 +0300)
committerDavid S. Miller <davem@davemloft.net>
Mon, 24 May 2021 20:20:24 +0000 (13:20 -0700)
commitdc596e3fe63f88e3d1e509f64e7f761cd4135538
tree005a7c3d3a778c936ffd56de8655a2af6ab8a9d3
parentba61cf167cb77e54c1ec5adb7aa49a22ab3c9b28
net: dsa: sja1105: call dsa_unregister_switch when allocating memory fails

Unlike other drivers which pretty much end their .probe() execution with
dsa_register_switch(), the sja1105 does some extra stuff. When that
fails with -ENOMEM, the driver is quick to return that, forgetting to
call dsa_unregister_switch(). Not critical, but a bug nonetheless.

Fixes: 4d7525085a9b ("net: dsa: sja1105: offload the Credit-Based Shaper qdisc")
Fixes: a68578c20a96 ("net: dsa: Make deferred_xmit private to sja1105")
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/dsa/sja1105/sja1105_main.c