linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Kalle Valo <kvalo@codeaurora.org>
To: Bob Copeland <me@bobcopeland.com>
Cc: linux-wireless@vger.kernel.org, Bob Copeland <me@bobcopeland.com>,
	Amitkumar Karwar <akarwar@marvell.com>,
	Nishant Sarmukadam <nishants@marvell.com>
Subject: Re: mwifiex: fix error handling in mwifiex_create_custom_regdomain
Date: Sat, 17 Sep 2016 15:26:20 +0000 (UTC)	[thread overview]
Message-ID: <20160917152620.41D326175D@smtp.codeaurora.org> (raw)
In-Reply-To: <20160914124236.1951-1-me@bobcopeland.com>

Bob Copeland <me@bobcopeland.com> wrote:
> smatch reports:
> 
> sta_cmdresp.c:1053 mwifiex_create_custom_regdomain() warn: possible memory leak of 'regd'
> 
> Indeed, mwifiex_create_custom_regdomain() returns NULL in the
> case that channel is missing in the TLV without freeing regd.
> 
> Moreover, some other error paths in this function return ERR_PTR
> values which are assigned without checking to the regd field in
> the mwifiex_adapter struct.  The latter is only null-checked where
> used.
> 
> Fix by freeing regd in the error path, and only update
> priv->adapter->regd if the returned pointer is valid.
> 
> Cc: Amitkumar Karwar <akarwar@marvell.com>
> Cc: Nishant Sarmukadam <nishants@marvell.com>
> Signed-off-by: Bob Copeland <me@bobcopeland.com>

Thanks, 1 patch applied to wireless-drivers-next.git:

92ca4f92eca7 mwifiex: fix error handling in mwifiex_create_custom_regdomain

-- 
Sent by pwcli
https://patchwork.kernel.org/patch/9331337/

      reply	other threads:[~2016-09-17 15:26 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-14 12:42 [PATCH] mwifiex: fix error handling in mwifiex_create_custom_regdomain Bob Copeland
2016-09-17 15:26 ` Kalle Valo [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=20160917152620.41D326175D@smtp.codeaurora.org \
    --to=kvalo@codeaurora.org \
    --cc=akarwar@marvell.com \
    --cc=linux-wireless@vger.kernel.org \
    --cc=me@bobcopeland.com \
    --cc=nishants@marvell.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).