linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 3.13 1/6] mwifiex: use return value of mwifiex_add_virtual_intf() correctly
@ 2013-11-15  3:10 Bing Zhao
  2013-11-15  3:10 ` [PATCH 3.13 2/6] mwifiex: failure path handling in mwifiex_add_virtual_intf() Bing Zhao
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Bing Zhao @ 2013-11-15  3:10 UTC (permalink / raw)
  To: linux-wireless
  Cc: John W. Linville, Amitkumar Karwar, Ujjal Roy, Avinash Patil,
	Nishant Sarmukadam, Frank Huang, Bing Zhao

From: Amitkumar Karwar <akarwar@marvell.com>

mwifiex_add_virtual_intf() returns ERR_PTR values. So use IS_ERR()
macro instead of checking for NULL pointer.

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 | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/mwifiex/main.c b/drivers/net/wireless/mwifiex/main.c
index 9d7c9d3..7c7da3e 100644
--- a/drivers/net/wireless/mwifiex/main.c
+++ b/drivers/net/wireless/mwifiex/main.c
@@ -418,6 +418,7 @@ static void mwifiex_fw_dpc(const struct firmware *firmware, void *context)
 	struct mwifiex_fw_image fw;
 	struct semaphore *sem = adapter->card_sem;
 	bool init_failed = false;
+	struct wireless_dev *wdev;
 
 	if (!firmware) {
 		dev_err(adapter->dev,
@@ -474,8 +475,9 @@ static void mwifiex_fw_dpc(const struct firmware *firmware, void *context)
 
 	rtnl_lock();
 	/* Create station interface by default */
-	if (!mwifiex_add_virtual_intf(adapter->wiphy, "mlan%d",
-				      NL80211_IFTYPE_STATION, NULL, NULL)) {
+	wdev = mwifiex_add_virtual_intf(adapter->wiphy, "mlan%d",
+					NL80211_IFTYPE_STATION, NULL, NULL);
+	if (IS_ERR(wdev)) {
 		dev_err(adapter->dev, "cannot create default STA interface\n");
 		goto err_add_intf;
 	}
-- 
1.8.2.3


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2013-11-15  3:11 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 ` [PATCH 3.13 3/6] mwifiex: fix NULL pointer dereference in mwifiex_fw_dpc Bing Zhao
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

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).