[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190918172106.GN9591@lunn.ch>
Date: Wed, 18 Sep 2019 19:21:06 +0200
From: Andrew Lunn <andrew@...n.ch>
To: Navid Emamdoost <navid.emamdoost@...il.com>
Cc: emamd001@....edu, smccaman@....edu, kjlu@....edu,
Vladimir Oltean <olteanv@...il.com>,
Vivien Didelot <vivien.didelot@...il.com>,
Florian Fainelli <f.fainelli@...il.com>,
"David S. Miller" <davem@...emloft.net>,
linux-kernel@...r.kernel.org, netdev@...r.kernel.org
Subject: Re: [PATCH] net: dsa: sja1105: prevent leaking memory
On Wed, Sep 18, 2019 at 12:10:19PM -0500, Navid Emamdoost wrote:
> 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.
>
> Signed-off-by: Navid Emamdoost <navid.emamdoost@...il.com>
Hi Navid
Please could you provide a Fixes: tag for where this memory leak was
introduced.
> ---
> drivers/net/dsa/sja1105/sja1105_spi.c | 8 +++++---
> 1 file changed, 5 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/net/dsa/sja1105/sja1105_spi.c b/drivers/net/dsa/sja1105/sja1105_spi.c
> index 84dc603138cf..80e86c714efb 100644
> --- a/drivers/net/dsa/sja1105/sja1105_spi.c
> +++ b/drivers/net/dsa/sja1105/sja1105_spi.c
> @@ -408,8 +408,9 @@ int sja1105_static_config_upload(struct sja1105_private *priv)
>
> rc = static_config_buf_prepare_for_upload(priv, config_buf, buf_len);
> if (rc < 0) {
> - dev_err(dev, "Invalid config, cannot upload\n");
> - return -EINVAL;
> + dev_err(dev, "Invalid config, cannot upload\n");
What changed in this dev_err() call?
Thanks
Andrew
Powered by blists - more mailing lists