From: Kalle Valo <kvalo@codeaurora.org>
To: Dinghao Liu <dinghao.liu@zju.edu.cn>
Cc: kjlu@umn.edu, Jouni Malinen <j@w1.fi>,
"David S. Miller" <davem@davemloft.net>,
Jakub Kicinski <kuba@kernel.org>,
Leon Romanovsky <leon@kernel.org>,
linux-wireless@vger.kernel.org, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] hostap: Fix memleak in prism2_config
Date: Wed, 07 Apr 2021 14:53:15 +0300 [thread overview]
Message-ID: <87tuoimhuc.fsf@codeaurora.org> (raw)
In-Reply-To: <20210329085246.24586-1-dinghao.liu@zju.edu.cn> (Dinghao Liu's message of "Mon, 29 Mar 2021 16:52:43 +0800")
Dinghao Liu <dinghao.liu@zju.edu.cn> writes:
> When prism2_hw_config() fails, we just return an error code
> without any resource release, which may lead to memleak.
>
> Signed-off-by: Dinghao Liu <dinghao.liu@zju.edu.cn>
> ---
> drivers/net/wireless/intersil/hostap/hostap_cs.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/net/wireless/intersil/hostap/hostap_cs.c b/drivers/net/wireless/intersil/hostap/hostap_cs.c
> index ec7db2badc40..7dc16ab50ad6 100644
> --- a/drivers/net/wireless/intersil/hostap/hostap_cs.c
> +++ b/drivers/net/wireless/intersil/hostap/hostap_cs.c
> @@ -536,10 +536,10 @@ static int prism2_config(struct pcmcia_device *link)
> sandisk_enable_wireless(dev);
>
> ret = prism2_hw_config(dev, 1);
> - if (!ret)
> - ret = hostap_hw_ready(dev);
> + if (ret)
> + goto failed;
>
> - return ret;
> + return hostap_hw_ready(dev);;
Two semicolons.
But I'm not sure about this, can someone provide a Reviewed-by tag?
--
https://patchwork.kernel.org/project/linux-wireless/list/
https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
next prev parent reply other threads:[~2021-04-07 11:53 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-03-29 8:52 [PATCH] hostap: Fix memleak in prism2_config Dinghao Liu
2021-04-07 11:53 ` Kalle Valo [this message]
2021-04-18 6:14 ` 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=87tuoimhuc.fsf@codeaurora.org \
--to=kvalo@codeaurora.org \
--cc=davem@davemloft.net \
--cc=dinghao.liu@zju.edu.cn \
--cc=j@w1.fi \
--cc=kjlu@umn.edu \
--cc=kuba@kernel.org \
--cc=leon@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-wireless@vger.kernel.org \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.