linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tony Lindgren <tony@atomide.com>
To: "Gustavo A. R. Silva" <gustavo@embeddedor.com>
Cc: Kalle Valo <kvalo@codeaurora.org>,
	"David S. Miller" <davem@davemloft.net>,
	linux-wireless@vger.kernel.org, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] wlcore: Fix memory leak in wlcore_cmd_wait_for_event_or_timeout
Date: Mon, 2 Jul 2018 04:30:08 -0700	[thread overview]
Message-ID: <20180702113008.GV112168@atomide.com> (raw)
In-Reply-To: <20180628130809.GA8147@embeddedor.com>

* Gustavo A. R. Silva <gustavo@embeddedor.com> [180628 13:11]:
> In case memory resources for *events_vector* were allocated, release
> them before return.
> 
> Addresses-Coverity-ID: 1470194 ("Resource leak")
> Fixes: 4ec7cece87b3 ("wlcore: Add missing PM call for wlcore_cmd_wait_for_event_or_timeout()")
> Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>

Thanks for catching this one:

Acked-by: Tony Lindgren <tony@atomide.com>

> ---
>  drivers/net/wireless/ti/wlcore/cmd.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/net/wireless/ti/wlcore/cmd.c b/drivers/net/wireless/ti/wlcore/cmd.c
> index 836c616..9039687 100644
> --- a/drivers/net/wireless/ti/wlcore/cmd.c
> +++ b/drivers/net/wireless/ti/wlcore/cmd.c
> @@ -195,8 +195,7 @@ int wlcore_cmd_wait_for_event_or_timeout(struct wl1271 *wl,
>  	ret = pm_runtime_get_sync(wl->dev);
>  	if (ret < 0) {
>  		pm_runtime_put_noidle(wl->dev);
> -
> -		return ret;
> +		goto free_vector;
>  	}
>  
>  	do {
> @@ -232,6 +231,7 @@ int wlcore_cmd_wait_for_event_or_timeout(struct wl1271 *wl,
>  out:
>  	pm_runtime_mark_last_busy(wl->dev);
>  	pm_runtime_put_autosuspend(wl->dev);
> +free_vector:
>  	kfree(events_vector);
>  	return ret;
>  }
> -- 
> 2.7.4
> 

  reply	other threads:[~2018-07-02 11:30 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-28 13:08 [PATCH] wlcore: Fix memory leak in wlcore_cmd_wait_for_event_or_timeout Gustavo A. R. Silva
2018-07-02 11:30 ` Tony Lindgren [this message]
2018-07-02 13:01   ` Gustavo A. R. Silva
2018-07-04 15: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=20180702113008.GV112168@atomide.com \
    --to=tony@atomide.com \
    --cc=davem@davemloft.net \
    --cc=gustavo@embeddedor.com \
    --cc=kvalo@codeaurora.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 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).