net: dsa: sja1105: Prevent leaking memory
authorNavid Emamdoost <navid.emamdoost@gmail.com>
Sat, 28 Sep 2019 22:43:39 +0000 (01:43 +0300)
committerDavid S. Miller <davem@davemloft.net>
Tue, 1 Oct 2019 00:24:43 +0000 (17:24 -0700)
commit68501df92d116b760777a2cfda314789f926476f
tree90b3c9a7b7b01615ac06e42c264a404d4aae11d7
parentb6f2494d311a19b33b19708543e7ef6dea1de459
net: dsa: sja1105: Prevent leaking memory

In sja1105_static_config_upload, in two cases memory is leaked: when
static_config_buf_prepare_for_upload fails and when sja1105_inhibit_tx
fails. In both cases config_buf should be released.

Fixes: 8aa9ebccae87 ("net: dsa: Introduce driver for NXP SJA1105 5-port L2 switch")
Fixes: 1a4c69406cc1 ("net: dsa: sja1105: Prevent PHY jabbering during switch reset")
Signed-off-by: Navid Emamdoost <navid.emamdoost@gmail.com>
Signed-off-by: Vladimir Oltean <olteanv@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/dsa/sja1105/sja1105_spi.c