linux-wpan.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stefan Schmidt <stefan@datenfreihafen.org>
To: Liu Jian <liujian56@huawei.com>,
	michael.hennerich@analog.com, alex.aring@gmail.com,
	davem@davemloft.net, kuba@kernel.org, kjlu@umn.edu,
	linux-wpan@vger.kernel.org, netdev@vger.kernel.org
Subject: Re: [PATCH net-next] ieee802154: fix one possible memleak in adf7242_probe
Date: Fri, 17 Jul 2020 11:52:59 +0200	[thread overview]
Message-ID: <79b20791-e78b-f2af-5355-7715aa3146b7@datenfreihafen.org> (raw)
In-Reply-To: <20200717090121.2143-1-liujian56@huawei.com>

Hello.

On 17.07.20 11:01, Liu Jian wrote:
> When probe fail, we should destroy the workqueue.
> 
> Fixes: 2795e8c25161 ("net: ieee802154: fix a potential NULL pointer dereference")
> Signed-off-by: Liu Jian <liujian56@huawei.com>
> ---
>   drivers/net/ieee802154/adf7242.c | 4 +++-
>   1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/net/ieee802154/adf7242.c b/drivers/net/ieee802154/adf7242.c
> index 5a37514e4234..8dbccec6ac86 100644
> --- a/drivers/net/ieee802154/adf7242.c
> +++ b/drivers/net/ieee802154/adf7242.c
> @@ -1262,7 +1262,7 @@ static int adf7242_probe(struct spi_device *spi)
>   					     WQ_MEM_RECLAIM);
>   	if (unlikely(!lp->wqueue)) {
>   		ret = -ENOMEM;
> -		goto err_hw_init;
> +		goto err_alloc_wq;
>   	}
>   
>   	ret = adf7242_hw_init(lp);
> @@ -1294,6 +1294,8 @@ static int adf7242_probe(struct spi_device *spi)
>   	return ret;
>   
>   err_hw_init:
> +	destroy_workqueue(lp->wqueue);
> +err_alloc_wq:
>   	mutex_destroy(&lp->bmux);
>   	ieee802154_free_hw(lp->hw);
>   
> 


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

regards
Stefan Schmidt

      parent reply	other threads:[~2020-07-17  9:53 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-17  9:01 [PATCH net-next] ieee802154: fix one possible memleak in adf7242_probe Liu Jian
2020-07-17  8:32 ` Hennerich, Michael
2020-07-17  9:52 ` Stefan Schmidt [this message]

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=79b20791-e78b-f2af-5355-7715aa3146b7@datenfreihafen.org \
    --to=stefan@datenfreihafen.org \
    --cc=alex.aring@gmail.com \
    --cc=davem@davemloft.net \
    --cc=kjlu@umn.edu \
    --cc=kuba@kernel.org \
    --cc=linux-wpan@vger.kernel.org \
    --cc=liujian56@huawei.com \
    --cc=michael.hennerich@analog.com \
    --cc=netdev@vger.kernel.org \
    /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).