]> git.baikalelectronics.ru Git - kernel.git/commit
net: dsa: sja1105: add error handling in sja1105_setup()
authorVladimir Oltean <vladimir.oltean@nxp.com>
Mon, 24 May 2021 09:25:24 +0000 (12:25 +0300)
committerDavid S. Miller <davem@davemloft.net>
Mon, 24 May 2021 20:20:24 +0000 (13:20 -0700)
commit31a06dcd3768cbe45c588d3202edb223e0feeda6
tree5e77036d80e9699ee3dc7a267fb39f397aa276f8
parent00bd9ad506f2bba7b9c1f028f9d3f3e2bd16fffa
net: dsa: sja1105: add error handling in sja1105_setup()

If any of sja1105_static_config_load(), sja1105_clocking_setup() or
sja1105_devlink_setup() fails, we can't just return in the middle of
sja1105_setup() or memory will leak. Add a cleanup path.

Fixes: 7e0f84434f45 ("net: dsa: sja1105: move devlink param code to sja1105_devlink.c")
Fixes: d6439dcd9177 ("net: dsa: Introduce driver for NXP SJA1105 5-port L2 switch")
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