]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/commit
net: dsa: sja1105: Prevent leaking memory
authorNavid Emamdoost <navid.emamdoost@gmail.com>
Sat, 28 Sep 2019 22:43:39 +0000 (01:43 +0300)
committerKhalid Elmously <khalid.elmously@canonical.com>
Fri, 18 Oct 2019 08:26:28 +0000 (04:26 -0400)
commit9901e5a066449202786cf8988fe97908681928ce
tree6ff28f1685d6f62c6d73ccc5b97a1e615bae066d
parent08113ea7a75cb0046d3a571a8131c4ff3ba7cb1c
net: dsa: sja1105: Prevent leaking memory

BugLink: https://bugs.launchpad.net/bugs/1848047
[ Upstream commit 68501df92d116b760777a2cfda314789f926476f ]

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
drivers/net/dsa/sja1105/sja1105_spi.c