diff options
author | Amitkumar Karwar <akarwar@marvell.com> | 2013-11-14 22:10:37 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2013-11-15 14:29:30 -0500 |
commit | 68b76e99d1f7b696d49b5e99286401150072987a (patch) | |
tree | c2a420deb2a1be9b5ae054f8fbed65f7c1a227aa /drivers/net | |
parent | b4089d6d8e71a7293e2192025dfa507a04f661c4 (diff) |
mwifiex: use return value of mwifiex_add_virtual_intf() correctly
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>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/wireless/mwifiex/main.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/net/wireless/mwifiex/main.c b/drivers/net/wireless/mwifiex/main.c index 9d7c9d354d34..7c7da3ea55a9 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) | |||
418 | struct mwifiex_fw_image fw; | 418 | struct mwifiex_fw_image fw; |
419 | struct semaphore *sem = adapter->card_sem; | 419 | struct semaphore *sem = adapter->card_sem; |
420 | bool init_failed = false; | 420 | bool init_failed = false; |
421 | struct wireless_dev *wdev; | ||
421 | 422 | ||
422 | if (!firmware) { | 423 | if (!firmware) { |
423 | dev_err(adapter->dev, | 424 | dev_err(adapter->dev, |
@@ -474,8 +475,9 @@ static void mwifiex_fw_dpc(const struct firmware *firmware, void *context) | |||
474 | 475 | ||
475 | rtnl_lock(); | 476 | rtnl_lock(); |
476 | /* Create station interface by default */ | 477 | /* Create station interface by default */ |
477 | if (!mwifiex_add_virtual_intf(adapter->wiphy, "mlan%d", | 478 | wdev = mwifiex_add_virtual_intf(adapter->wiphy, "mlan%d", |
478 | NL80211_IFTYPE_STATION, NULL, NULL)) { | 479 | NL80211_IFTYPE_STATION, NULL, NULL); |
480 | if (IS_ERR(wdev)) { | ||
479 | dev_err(adapter->dev, "cannot create default STA interface\n"); | 481 | dev_err(adapter->dev, "cannot create default STA interface\n"); |
480 | goto err_add_intf; | 482 | goto err_add_intf; |
481 | } | 483 | } |