Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wirel...
[cascardo/linux.git] / drivers / net / wireless / mwifiex / sta_ioctl.c
index f542bb8..7eef745 100644 (file)
@@ -162,13 +162,9 @@ int mwifiex_fill_new_bss_desc(struct mwifiex_private *priv,
 
        rcu_read_lock();
        ies = rcu_dereference(bss->ies);
-       if (WARN_ON(!ies)) {
-               /* should never happen */
-               rcu_read_unlock();
-               return -EINVAL;
-       }
        beacon_ie = kmemdup(ies->data, ies->len, GFP_ATOMIC);
        beacon_ie_len = ies->len;
+       bss_desc->timestamp = ies->tsf;
        rcu_read_unlock();
 
        if (!beacon_ie) {
@@ -184,7 +180,6 @@ int mwifiex_fill_new_bss_desc(struct mwifiex_private *priv,
        bss_desc->cap_info_bitmap = bss->capability;
        bss_desc->bss_band = bss_priv->band;
        bss_desc->fw_tsf = bss_priv->fw_tsf;
-       bss_desc->timestamp = bss->tsf;
        if (bss_desc->cap_info_bitmap & WLAN_CAPABILITY_PRIVACY) {
                dev_dbg(priv->adapter->dev, "info: InterpretIE: AP WEP enabled\n");
                bss_desc->privacy = MWIFIEX_802_11_PRIV_FILTER_8021X_WEP;
@@ -266,11 +261,9 @@ int mwifiex_bss_start(struct mwifiex_private *priv, struct cfg80211_bss *bss,
 
                /* Allocate and fill new bss descriptor */
                bss_desc = kzalloc(sizeof(struct mwifiex_bssdescriptor),
-                               GFP_KERNEL);
-               if (!bss_desc) {
-                       dev_err(priv->adapter->dev, " failed to alloc bss_desc\n");
+                                  GFP_KERNEL);
+               if (!bss_desc)
                        return -ENOMEM;
-               }
 
                ret = mwifiex_fill_new_bss_desc(priv, bss, bss_desc);
                if (ret)
@@ -324,7 +317,7 @@ int mwifiex_bss_start(struct mwifiex_private *priv, struct cfg80211_bss *bss,
                }
 
                if (bss)
-                       cfg80211_put_bss(bss);
+                       cfg80211_put_bss(priv->adapter->wiphy, bss);
        } else {
                /* Adhoc mode */
                /* If the requested SSID matches current SSID, return */
@@ -354,7 +347,7 @@ int mwifiex_bss_start(struct mwifiex_private *priv, struct cfg80211_bss *bss,
                                                        " list. Joining...\n");
                        ret = mwifiex_adhoc_join(priv, bss_desc);
                        if (bss)
-                               cfg80211_put_bss(bss);
+                               cfg80211_put_bss(priv->adapter->wiphy, bss);
                } else {
                        dev_dbg(adapter->dev, "info: Network not found in "
                                "the list, creating adhoc with ssid = %s\n",
@@ -636,11 +629,8 @@ int mwifiex_set_tx_power(struct mwifiex_private *priv,
                }
        }
        buf = kzalloc(MWIFIEX_SIZE_OF_CMD_BUFFER, GFP_KERNEL);
-       if (!buf) {
-               dev_err(priv->adapter->dev, "%s: failed to alloc cmd buffer\n",
-                       __func__);
+       if (!buf)
                return -ENOMEM;
-       }
 
        txp_cfg = (struct host_cmd_ds_txpwr_cfg *) buf;
        txp_cfg->action = cpu_to_le16(HostCmd_ACT_GEN_SET);