From: Bing Zhao <bzhao@marvell.com>
To: <linux-wireless@vger.kernel.org>
Cc: "John W. Linville" <linville@tuxdriver.com>,
Amitkumar Karwar <akarwar@marvell.com>,
Ujjal Roy <royujjal@gmail.com>,
Avinash Patil <patila@marvell.com>,
Nishant Sarmukadam <nishants@marvell.com>,
Frank Huang <frankh@marvell.com>, Bing Zhao <bzhao@marvell.com>
Subject: [PATCH 3.13 3/6] mwifiex: fix NULL pointer dereference in mwifiex_fw_dpc
Date: Thu, 14 Nov 2013 19:10:39 -0800 [thread overview]
Message-ID: <1384485042-7083-3-git-send-email-bzhao@marvell.com> (raw)
In-Reply-To: <1384485042-7083-1-git-send-email-bzhao@marvell.com>
From: Amitkumar Karwar <akarwar@marvell.com>
We don't need to free/unregister wiphy when
mwifiex_register_cfg80211() fails. The routine internally takes
care of it. This redundant code can cause NULL pointer dereference,
for adapter->wiphy.
Reported-by: Ujjal Roy <royujjal@gmail.com>
Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
---
drivers/net/wireless/mwifiex/main.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/net/wireless/mwifiex/main.c b/drivers/net/wireless/mwifiex/main.c
index 9236b42..42d9a68 100644
--- a/drivers/net/wireless/mwifiex/main.c
+++ b/drivers/net/wireless/mwifiex/main.c
@@ -470,7 +470,7 @@ static void mwifiex_fw_dpc(const struct firmware *firmware, void *context)
priv = adapter->priv[MWIFIEX_BSS_ROLE_STA];
if (mwifiex_register_cfg80211(adapter)) {
dev_err(adapter->dev, "cannot register with cfg80211\n");
- goto err_register_cfg80211;
+ goto err_init_fw;
}
rtnl_lock();
@@ -489,7 +489,6 @@ static void mwifiex_fw_dpc(const struct firmware *firmware, void *context)
goto done;
err_add_intf:
-err_register_cfg80211:
wiphy_unregister(adapter->wiphy);
wiphy_free(adapter->wiphy);
err_init_fw:
--
1.8.2.3
next prev parent reply other threads:[~2013-11-15 3:10 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-11-15 3:10 [PATCH 3.13 1/6] mwifiex: use return value of mwifiex_add_virtual_intf() correctly Bing Zhao
2013-11-15 3:10 ` [PATCH 3.13 2/6] mwifiex: failure path handling in mwifiex_add_virtual_intf() Bing Zhao
2013-11-15 3:10 ` Bing Zhao [this message]
2013-11-15 3:10 ` [PATCH 3.13 4/6] mwifiex: fix potential mem leak in .del_virtual_intf Bing Zhao
2013-11-15 3:10 ` [PATCH 3.13 5/6] mwifiex: fix memory leak issue for sdio and pcie cards Bing Zhao
2013-11-15 3:10 ` [PATCH 3.13 6/6] mwifiex: fix issues in driver unload path for USB chipsets Bing Zhao
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=1384485042-7083-3-git-send-email-bzhao@marvell.com \
--to=bzhao@marvell.com \
--cc=akarwar@marvell.com \
--cc=frankh@marvell.com \
--cc=linux-wireless@vger.kernel.org \
--cc=linville@tuxdriver.com \
--cc=nishants@marvell.com \
--cc=patila@marvell.com \
--cc=royujjal@gmail.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).