netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sergey Matyukevich <geomatsi@gmail.com>
To: Wang Hai <wanghai38@huawei.com>
Cc: imitsyanko@quantenna.com, kvalo@codeaurora.org,
	davem@davemloft.net, kuba@kernel.org, mst@redhat.com,
	mkarpenko@quantenna.com, linux-wireless@vger.kernel.org,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH net] qtnfmac: Missing platform_device_unregister() on error in qtnf_core_mac_alloc()
Date: Thu, 30 Jul 2020 13:20:23 +0300	[thread overview]
Message-ID: <20200730102023.GA2249@curiosity> (raw)
In-Reply-To: <20200730064910.37589-1-wanghai38@huawei.com>

> Add the missing platform_device_unregister() before return from
> qtnf_core_mac_alloc() in the error handling case.
> 
> Fixes: 616f5701f4ab ("qtnfmac: assign each wiphy to its own virtual platform device")
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: Wang Hai <wanghai38@huawei.com>
> ---
>  drivers/net/wireless/quantenna/qtnfmac/core.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/net/wireless/quantenna/qtnfmac/core.c b/drivers/net/wireless/quantenna/qtnfmac/core.c
> index eea777f8acea..6aafff9d4231 100644
> --- a/drivers/net/wireless/quantenna/qtnfmac/core.c
> +++ b/drivers/net/wireless/quantenna/qtnfmac/core.c
> @@ -446,8 +446,11 @@ static struct qtnf_wmac *qtnf_core_mac_alloc(struct qtnf_bus *bus,
>  	}
>  
>  	wiphy = qtnf_wiphy_allocate(bus, pdev);
> -	if (!wiphy)
> +	if (!wiphy) {
> +		if (pdev)
> +			platform_device_unregister(pdev);
>  		return ERR_PTR(-ENOMEM);
> +	}
>  
>  	mac = wiphy_priv(wiphy);

Reviewed-by: Sergey Matyukevich <geomatsi@gmail.com>

Thanks,
Sergey

  reply	other threads:[~2020-07-30 10:15 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-30  6:49 [PATCH net] qtnfmac: Missing platform_device_unregister() on error in qtnf_core_mac_alloc() Wang Hai
2020-07-30 10:20 ` Sergey Matyukevich [this message]
2020-08-02 15:20 ` Kalle Valo

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=20200730102023.GA2249@curiosity \
    --to=geomatsi@gmail.com \
    --cc=davem@davemloft.net \
    --cc=imitsyanko@quantenna.com \
    --cc=kuba@kernel.org \
    --cc=kvalo@codeaurora.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=mkarpenko@quantenna.com \
    --cc=mst@redhat.com \
    --cc=netdev@vger.kernel.org \
    --cc=wanghai38@huawei.com \
    /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).