linux-wpan.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stefan Schmidt <stefan@datenfreihafen.org>
To: Navid Emamdoost <navid.emamdoost@gmail.com>
Cc: emamd001@umn.edu, smccaman@umn.edu, kjlu@umn.edu,
	Harry Morris <h.morris@cascoda.com>,
	Alexander Aring <alex.aring@gmail.com>,
	"David S. Miller" <davem@davemloft.net>,
	linux-wpan@vger.kernel.org, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] ieee802154: ca8210: prevent memory leak
Date: Fri, 27 Sep 2019 22:01:08 +0200	[thread overview]
Message-ID: <cda67450-267f-3c94-68b6-73ea8c4dfe2f@datenfreihafen.org> (raw)
In-Reply-To: <20190917224713.26371-1-navid.emamdoost@gmail.com>

Hello.

On 18.09.19 00:47, Navid Emamdoost wrote:
> In ca8210_probe the allocated pdata needs to be assigned to
> spi_device->dev.platform_data before calling ca8210_get_platform_data.
> Othrwise when ca8210_get_platform_data fails pdata cannot be released.
> 
> Signed-off-by: Navid Emamdoost <navid.emamdoost@gmail.com>
> ---
>   drivers/net/ieee802154/ca8210.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/net/ieee802154/ca8210.c b/drivers/net/ieee802154/ca8210.c
> index b188fce3f641..229d70a897ca 100644
> --- a/drivers/net/ieee802154/ca8210.c
> +++ b/drivers/net/ieee802154/ca8210.c
> @@ -3152,12 +3152,12 @@ static int ca8210_probe(struct spi_device *spi_device)
>   		goto error;
>   	}
>   
> +	priv->spi->dev.platform_data = pdata;
>   	ret = ca8210_get_platform_data(priv->spi, pdata);
>   	if (ret) {
>   		dev_crit(&spi_device->dev, "ca8210_get_platform_data failed\n");
>   		goto error;
>   	}
> -	priv->spi->dev.platform_data = pdata;
>   
>   	ret = ca8210_dev_com_init(priv);
>   	if (ret) {
> 

As Harry seems to be unavailable I am taking this patch directly.


This patch has been applied to the wpan tree and will be
part of the next pull request to net. Thanks!

regards
Stefan Schmidt

           reply	other threads:[~2019-09-27 20:01 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <20190917224713.26371-1-navid.emamdoost@gmail.com>]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=cda67450-267f-3c94-68b6-73ea8c4dfe2f@datenfreihafen.org \
    --to=stefan@datenfreihafen.org \
    --cc=alex.aring@gmail.com \
    --cc=davem@davemloft.net \
    --cc=emamd001@umn.edu \
    --cc=h.morris@cascoda.com \
    --cc=kjlu@umn.edu \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-wpan@vger.kernel.org \
    --cc=navid.emamdoost@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=smccaman@umn.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).