diff options
author | Bing Zhao <bzhao@marvell.com> | 2012-10-19 22:02:00 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2012-10-24 13:18:09 -0400 |
commit | 6fcf2b10533bf51c67f0286ddba16e958e7ed972 (patch) | |
tree | 3083933bb30176bbfd8bc0343d15bae662e114dd | |
parent | dcd5c79c9a3a7ac08bdce089fec810677ce6efe8 (diff) |
mwifiex: clean up scan state on error
De-reference and deallocate scan state on failure.
Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: Paul Stewart <pstew@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
Reviewed-by: Ryan Cairns <rtc@chromium.org>
Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r-- | drivers/net/wireless/mwifiex/cfg80211.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/net/wireless/mwifiex/cfg80211.c b/drivers/net/wireless/mwifiex/cfg80211.c index 0679458a1bac..780d3e168297 100644 --- a/drivers/net/wireless/mwifiex/cfg80211.c +++ b/drivers/net/wireless/mwifiex/cfg80211.c | |||
@@ -1825,8 +1825,6 @@ mwifiex_cfg80211_scan(struct wiphy *wiphy, | |||
1825 | return -EBUSY; | 1825 | return -EBUSY; |
1826 | } | 1826 | } |
1827 | 1827 | ||
1828 | priv->scan_request = request; | ||
1829 | |||
1830 | priv->user_scan_cfg = kzalloc(sizeof(struct mwifiex_user_scan_cfg), | 1828 | priv->user_scan_cfg = kzalloc(sizeof(struct mwifiex_user_scan_cfg), |
1831 | GFP_KERNEL); | 1829 | GFP_KERNEL); |
1832 | if (!priv->user_scan_cfg) { | 1830 | if (!priv->user_scan_cfg) { |
@@ -1834,6 +1832,8 @@ mwifiex_cfg80211_scan(struct wiphy *wiphy, | |||
1834 | return -ENOMEM; | 1832 | return -ENOMEM; |
1835 | } | 1833 | } |
1836 | 1834 | ||
1835 | priv->scan_request = request; | ||
1836 | |||
1837 | priv->user_scan_cfg->num_ssids = request->n_ssids; | 1837 | priv->user_scan_cfg->num_ssids = request->n_ssids; |
1838 | priv->user_scan_cfg->ssid_list = request->ssids; | 1838 | priv->user_scan_cfg->ssid_list = request->ssids; |
1839 | 1839 | ||
@@ -1870,6 +1870,9 @@ mwifiex_cfg80211_scan(struct wiphy *wiphy, | |||
1870 | ret = mwifiex_scan_networks(priv, priv->user_scan_cfg); | 1870 | ret = mwifiex_scan_networks(priv, priv->user_scan_cfg); |
1871 | if (ret) { | 1871 | if (ret) { |
1872 | dev_err(priv->adapter->dev, "scan failed: %d\n", ret); | 1872 | dev_err(priv->adapter->dev, "scan failed: %d\n", ret); |
1873 | priv->scan_request = NULL; | ||
1874 | kfree(priv->user_scan_cfg); | ||
1875 | priv->user_scan_cfg = NULL; | ||
1873 | return ret; | 1876 | return ret; |
1874 | } | 1877 | } |
1875 | 1878 | ||