diff options
author | Amitkumar Karwar <akarwar@marvell.com> | 2013-11-14 22:10:39 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2013-11-15 14:29:31 -0500 |
commit | d1af2943da89f180274c846d593049e464026baf (patch) | |
tree | 1bba26d3af4d7121558e51ab0c40b0030030f2f0 /drivers/net/wireless/mwifiex/main.c | |
parent | bec568ff51078276109e21b5521829e2dd60a7fa (diff) |
mwifiex: fix NULL pointer dereference in mwifiex_fw_dpc
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>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/mwifiex/main.c')
-rw-r--r-- | drivers/net/wireless/mwifiex/main.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/net/wireless/mwifiex/main.c b/drivers/net/wireless/mwifiex/main.c index 9236b42007fb..42d9a68f45de 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) | |||
470 | priv = adapter->priv[MWIFIEX_BSS_ROLE_STA]; | 470 | priv = adapter->priv[MWIFIEX_BSS_ROLE_STA]; |
471 | if (mwifiex_register_cfg80211(adapter)) { | 471 | if (mwifiex_register_cfg80211(adapter)) { |
472 | dev_err(adapter->dev, "cannot register with cfg80211\n"); | 472 | dev_err(adapter->dev, "cannot register with cfg80211\n"); |
473 | goto err_register_cfg80211; | 473 | goto err_init_fw; |
474 | } | 474 | } |
475 | 475 | ||
476 | rtnl_lock(); | 476 | rtnl_lock(); |
@@ -489,7 +489,6 @@ static void mwifiex_fw_dpc(const struct firmware *firmware, void *context) | |||
489 | goto done; | 489 | goto done; |
490 | 490 | ||
491 | err_add_intf: | 491 | err_add_intf: |
492 | err_register_cfg80211: | ||
493 | wiphy_unregister(adapter->wiphy); | 492 | wiphy_unregister(adapter->wiphy); |
494 | wiphy_free(adapter->wiphy); | 493 | wiphy_free(adapter->wiphy); |
495 | err_init_fw: | 494 | err_init_fw: |