diff options
author | John W. Linville <linville@tuxdriver.com> | 2012-07-09 16:34:34 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2012-07-09 16:34:34 -0400 |
commit | 635d999fd3b9f0ddc899eaf45fc49bec65c0b8e2 (patch) | |
tree | 0456542caa85aff0f4edf91707e36850f76d585f /drivers/net/wireless/mwifiex/cfg80211.c | |
parent | 34202e28fe7fc8551313f9a035a8857db83de757 (diff) | |
parent | b48d96652626b315229b1b82c6270eead6a77a6d (diff) |
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless
Conflicts:
net/mac80211/mlme.c
Diffstat (limited to 'drivers/net/wireless/mwifiex/cfg80211.c')
-rw-r--r-- | drivers/net/wireless/mwifiex/cfg80211.c | 26 |
1 files changed, 12 insertions, 14 deletions
diff --git a/drivers/net/wireless/mwifiex/cfg80211.c b/drivers/net/wireless/mwifiex/cfg80211.c index bb06d2e3274a..75843fddbad4 100644 --- a/drivers/net/wireless/mwifiex/cfg80211.c +++ b/drivers/net/wireless/mwifiex/cfg80211.c | |||
@@ -976,6 +976,7 @@ static int mwifiex_cfg80211_start_ap(struct wiphy *wiphy, | |||
976 | case NL80211_HIDDEN_SSID_ZERO_CONTENTS: | 976 | case NL80211_HIDDEN_SSID_ZERO_CONTENTS: |
977 | /* firmware doesn't support this type of hidden SSID */ | 977 | /* firmware doesn't support this type of hidden SSID */ |
978 | default: | 978 | default: |
979 | kfree(bss_cfg); | ||
979 | return -EINVAL; | 980 | return -EINVAL; |
980 | } | 981 | } |
981 | 982 | ||
@@ -1525,7 +1526,7 @@ struct net_device *mwifiex_add_virtual_intf(struct wiphy *wiphy, | |||
1525 | struct wireless_dev *wdev; | 1526 | struct wireless_dev *wdev; |
1526 | 1527 | ||
1527 | if (!adapter) | 1528 | if (!adapter) |
1528 | return NULL; | 1529 | return ERR_PTR(-EFAULT); |
1529 | 1530 | ||
1530 | switch (type) { | 1531 | switch (type) { |
1531 | case NL80211_IFTYPE_UNSPECIFIED: | 1532 | case NL80211_IFTYPE_UNSPECIFIED: |
@@ -1535,12 +1536,12 @@ struct net_device *mwifiex_add_virtual_intf(struct wiphy *wiphy, | |||
1535 | if (priv->bss_mode) { | 1536 | if (priv->bss_mode) { |
1536 | wiphy_err(wiphy, | 1537 | wiphy_err(wiphy, |
1537 | "cannot create multiple sta/adhoc ifaces\n"); | 1538 | "cannot create multiple sta/adhoc ifaces\n"); |
1538 | return NULL; | 1539 | return ERR_PTR(-EINVAL); |
1539 | } | 1540 | } |
1540 | 1541 | ||
1541 | wdev = kzalloc(sizeof(struct wireless_dev), GFP_KERNEL); | 1542 | wdev = kzalloc(sizeof(struct wireless_dev), GFP_KERNEL); |
1542 | if (!wdev) | 1543 | if (!wdev) |
1543 | return NULL; | 1544 | return ERR_PTR(-ENOMEM); |
1544 | 1545 | ||
1545 | wdev->wiphy = wiphy; | 1546 | wdev->wiphy = wiphy; |
1546 | priv->wdev = wdev; | 1547 | priv->wdev = wdev; |
@@ -1563,12 +1564,12 @@ struct net_device *mwifiex_add_virtual_intf(struct wiphy *wiphy, | |||
1563 | 1564 | ||
1564 | if (priv->bss_mode) { | 1565 | if (priv->bss_mode) { |
1565 | wiphy_err(wiphy, "Can't create multiple AP interfaces"); | 1566 | wiphy_err(wiphy, "Can't create multiple AP interfaces"); |
1566 | return NULL; | 1567 | return ERR_PTR(-EINVAL); |
1567 | } | 1568 | } |
1568 | 1569 | ||
1569 | wdev = kzalloc(sizeof(struct wireless_dev), GFP_KERNEL); | 1570 | wdev = kzalloc(sizeof(struct wireless_dev), GFP_KERNEL); |
1570 | if (!wdev) | 1571 | if (!wdev) |
1571 | return NULL; | 1572 | return ERR_PTR(-ENOMEM); |
1572 | 1573 | ||
1573 | priv->wdev = wdev; | 1574 | priv->wdev = wdev; |
1574 | wdev->wiphy = wiphy; | 1575 | wdev->wiphy = wiphy; |
@@ -1585,14 +1586,15 @@ struct net_device *mwifiex_add_virtual_intf(struct wiphy *wiphy, | |||
1585 | break; | 1586 | break; |
1586 | default: | 1587 | default: |
1587 | wiphy_err(wiphy, "type not supported\n"); | 1588 | wiphy_err(wiphy, "type not supported\n"); |
1588 | return NULL; | 1589 | return ERR_PTR(-EINVAL); |
1589 | } | 1590 | } |
1590 | 1591 | ||
1591 | dev = alloc_netdev_mq(sizeof(struct mwifiex_private *), name, | 1592 | dev = alloc_netdev_mq(sizeof(struct mwifiex_private *), name, |
1592 | ether_setup, 1); | 1593 | ether_setup, 1); |
1593 | if (!dev) { | 1594 | if (!dev) { |
1594 | wiphy_err(wiphy, "no memory available for netdevice\n"); | 1595 | wiphy_err(wiphy, "no memory available for netdevice\n"); |
1595 | goto error; | 1596 | priv->bss_mode = NL80211_IFTYPE_UNSPECIFIED; |
1597 | return ERR_PTR(-ENOMEM); | ||
1596 | } | 1598 | } |
1597 | 1599 | ||
1598 | mwifiex_init_priv_params(priv, dev); | 1600 | mwifiex_init_priv_params(priv, dev); |
@@ -1623,7 +1625,9 @@ struct net_device *mwifiex_add_virtual_intf(struct wiphy *wiphy, | |||
1623 | /* Register network device */ | 1625 | /* Register network device */ |
1624 | if (register_netdevice(dev)) { | 1626 | if (register_netdevice(dev)) { |
1625 | wiphy_err(wiphy, "cannot register virtual network device\n"); | 1627 | wiphy_err(wiphy, "cannot register virtual network device\n"); |
1626 | goto error; | 1628 | free_netdev(dev); |
1629 | priv->bss_mode = NL80211_IFTYPE_UNSPECIFIED; | ||
1630 | return ERR_PTR(-EFAULT); | ||
1627 | } | 1631 | } |
1628 | 1632 | ||
1629 | sema_init(&priv->async_sem, 1); | 1633 | sema_init(&priv->async_sem, 1); |
@@ -1635,12 +1639,6 @@ struct net_device *mwifiex_add_virtual_intf(struct wiphy *wiphy, | |||
1635 | mwifiex_dev_debugfs_init(priv); | 1639 | mwifiex_dev_debugfs_init(priv); |
1636 | #endif | 1640 | #endif |
1637 | return dev; | 1641 | return dev; |
1638 | error: | ||
1639 | if (dev && (dev->reg_state == NETREG_UNREGISTERED)) | ||
1640 | free_netdev(dev); | ||
1641 | priv->bss_mode = NL80211_IFTYPE_UNSPECIFIED; | ||
1642 | |||
1643 | return NULL; | ||
1644 | } | 1642 | } |
1645 | EXPORT_SYMBOL_GPL(mwifiex_add_virtual_intf); | 1643 | EXPORT_SYMBOL_GPL(mwifiex_add_virtual_intf); |
1646 | 1644 | ||