]> git.proxmox.com Git - mirror_ubuntu-disco-kernel.git/commitdiff
cfg80211: pass wiphy to cfg80211_ref_bss/put_bss
authorJohannes Berg <johannes.berg@intel.com>
Fri, 1 Feb 2013 00:49:58 +0000 (01:49 +0100)
committerJohannes Berg <johannes.berg@intel.com>
Mon, 11 Feb 2013 17:44:52 +0000 (18:44 +0100)
This prepares for using the spinlock instead of krefs
which is needed in the next patch to track the refs
of combined BSSes correctly.

Acked-by: Bing Zhao <bzhao@marvell.com> [mwifiex]
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
21 files changed:
drivers/net/wireless/ath/ath6kl/cfg80211.c
drivers/net/wireless/ath/ath6kl/wmi.c
drivers/net/wireless/ath/wil6210/cfg80211.c
drivers/net/wireless/ath/wil6210/wmi.c
drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c
drivers/net/wireless/libertas/cfg.c
drivers/net/wireless/mwifiex/cfg80211.c
drivers/net/wireless/mwifiex/scan.c
drivers/net/wireless/mwifiex/sta_ioctl.c
drivers/net/wireless/orinoco/scan.c
drivers/net/wireless/rndis_wlan.c
drivers/staging/wlan-ng/cfg80211.c
include/net/cfg80211.h
net/mac80211/ibss.c
net/mac80211/mlme.c
net/mac80211/scan.c
net/wireless/core.c
net/wireless/ibss.c
net/wireless/mlme.c
net/wireless/scan.c
net/wireless/sme.c

index 4225cca0f198199a4e0b0e28ee5b4748cb85a45d..a7fb442a99aaed13c064925c4e6149f714610ae5 100644 (file)
@@ -767,7 +767,7 @@ void ath6kl_cfg80211_connect_event(struct ath6kl_vif *vif, u16 channel,
                ath6kl_dbg(ATH6KL_DBG_WLAN_CFG, "ad-hoc %s selected\n",
                           nw_type & ADHOC_CREATOR ? "creator" : "joiner");
                cfg80211_ibss_joined(vif->ndev, bssid, GFP_KERNEL);
-               cfg80211_put_bss(bss);
+               cfg80211_put_bss(ar->wiphy, bss);
                return;
        }
 
@@ -778,7 +778,7 @@ void ath6kl_cfg80211_connect_event(struct ath6kl_vif *vif, u16 channel,
                                        assoc_req_ie, assoc_req_len,
                                        assoc_resp_ie, assoc_resp_len,
                                        WLAN_STATUS_SUCCESS, GFP_KERNEL);
-               cfg80211_put_bss(bss);
+               cfg80211_put_bss(ar->wiphy, bss);
        } else if (vif->sme_state == SME_CONNECTED) {
                /* inform roam event to cfg80211 */
                cfg80211_roamed_bss(vif->ndev, bss, assoc_req_ie, assoc_req_len,
index 998f8b0f62fd59e4d6507216bf257f0ed4776dcf..d366cf105c7c886a4aa1e78355fa47ec908a0680 100644 (file)
@@ -1108,7 +1108,7 @@ static int ath6kl_wmi_bssinfo_event_rx(struct wmi *wmi, u8 *datap, int len,
        kfree(mgmt);
        if (bss == NULL)
                return -ENOMEM;
-       cfg80211_put_bss(bss);
+       cfg80211_put_bss(ar->wiphy, bss);
 
        /*
         * Firmware doesn't return any event when scheduled scan has
index 002851fceb2f9072a4498e623e64a8f755f014ee..9ecc1968262cd4d98f336c75445aee4e08cb3c21 100644 (file)
@@ -341,7 +341,7 @@ static int wil_cfg80211_connect(struct wiphy *wiphy,
        }
 
  out:
-       cfg80211_put_bss(bss);
+       cfg80211_put_bss(wiphy, bss);
 
        return rc;
 }
index 0b70e17cd1fb3c195d2c8e024acca7e6c499394c..79d608caa90319642aaaf2a49bff4d42e597e231 100644 (file)
@@ -338,7 +338,7 @@ static void wmi_evt_rx_mgmt(struct wil6210_priv *wil, int id, void *d, int len)
                if (bss) {
                        wil_dbg_wmi(wil, "Added BSS %pM\n",
                                    rx_mgmt_frame->bssid);
-                       cfg80211_put_bss(bss);
+                       cfg80211_put_bss(wiphy, bss);
                } else {
                        wil_err(wil, "cfg80211_inform_bss() failed\n");
                }
index 481f41ad7989e10fdcebb7cd692f1f84531fc737..cecc3eff72e976a2adba29ffb291bd60c928cf7a 100644 (file)
@@ -2323,7 +2323,7 @@ static s32 brcmf_inform_single_bss(struct brcmf_cfg80211_info *cfg,
        if (!bss)
                return -ENOMEM;
 
-       cfg80211_put_bss(bss);
+       cfg80211_put_bss(wiphy, bss);
 
        return err;
 }
@@ -2429,7 +2429,7 @@ static s32 wl_inform_ibss(struct brcmf_cfg80211_info *cfg,
                goto CleanUp;
        }
 
-       cfg80211_put_bss(bss);
+       cfg80211_put_bss(wiphy, bss);
 
 CleanUp:
 
index 230f8ebbe28921f6786e250b4f88cb421c013385..61735db3b0515684a82983c713c4bd4120242fbe 100644 (file)
@@ -657,7 +657,7 @@ static int lbs_ret_scan(struct lbs_private *priv, unsigned long dummy,
                                        capa, intvl, ie, ielen,
                                        LBS_SCAN_RSSI_TO_MBM(rssi),
                                        GFP_KERNEL);
-                               cfg80211_put_bss(bss);
+                               cfg80211_put_bss(wiphy, bss);
                        }
                } else
                        lbs_deb_scan("scan response: missing BSS channel IE\n");
@@ -1444,7 +1444,7 @@ static int lbs_cfg_connect(struct wiphy *wiphy, struct net_device *dev,
 
  done:
        if (bss)
-               cfg80211_put_bss(bss);
+               cfg80211_put_bss(wiphy, bss);
        lbs_deb_leave_args(LBS_DEB_CFG80211, "ret %d", ret);
        return ret;
 }
@@ -1766,7 +1766,7 @@ static void lbs_join_post(struct lbs_private *priv,
                                  params->beacon_interval,
                                  fake_ie, fake - fake_ie,
                                  0, GFP_KERNEL);
-       cfg80211_put_bss(bss);
+       cfg80211_put_bss(priv->wdev->wiphy, bss);
 
        memcpy(priv->wdev->ssid, params->ssid, params->ssid_len);
        priv->wdev->ssid_len = params->ssid_len;
@@ -2011,7 +2011,7 @@ static int lbs_join_ibss(struct wiphy *wiphy, struct net_device *dev,
 
        if (bss) {
                ret = lbs_ibss_join_existing(priv, params, bss);
-               cfg80211_put_bss(bss);
+               cfg80211_put_bss(wiphy, bss);
        } else
                ret = lbs_ibss_start_new(priv, params);
 
index 3a004b85b99fd91cc973762942026b838f641545..81c84a29308f9d93ffac48243bcd39b939949ce3 100644 (file)
@@ -1430,7 +1430,7 @@ static int mwifiex_cfg80211_inform_ibss_bss(struct mwifiex_private *priv)
        bss = cfg80211_inform_bss(priv->wdev->wiphy, chan,
                                  bss_info.bssid, 0, WLAN_CAPABILITY_IBSS,
                                  0, ie_buf, ie_len, 0, GFP_KERNEL);
-       cfg80211_put_bss(bss);
+       cfg80211_put_bss(priv->wdev->wiphy, bss);
        memcpy(priv->cfg_bssid, bss_info.bssid, ETH_ALEN);
 
        return 0;
index 9189a32b7844b713815636d03517e7532da31f94..232492487527aad0601bdb8913989954783c63f1 100644 (file)
@@ -1746,7 +1746,7 @@ int mwifiex_ret_802_11_scan(struct mwifiex_private *priv,
                                            .mac_address, ETH_ALEN))
                                        mwifiex_update_curr_bss_params(priv,
                                                                       bss);
-                               cfg80211_put_bss(bss);
+                               cfg80211_put_bss(priv->wdev->wiphy, bss);
                        }
                } else {
                        dev_dbg(adapter->dev, "missing BSS channel IE\n");
index f542bb8ccbc8d4ce6859e8fff1e45784183f8fbb..ee85b41a4dfdcd8e5e06b502659a2f791036a186 100644 (file)
@@ -324,7 +324,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 +354,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",
index 96e39edfec770c58363237e9fa2955d4f16e567e..e8c5714bfd11c24642933b824d299c165a768b27 100644 (file)
@@ -125,7 +125,7 @@ static void orinoco_add_hostscan_result(struct orinoco_private *priv,
        cbss = cfg80211_inform_bss(wiphy, channel, bss->a.bssid, timestamp,
                                   capability, beacon_interval, ie_buf, ie_len,
                                   signal, GFP_KERNEL);
-       cfg80211_put_bss(cbss);
+       cfg80211_put_bss(wiphy, cbss);
 }
 
 void orinoco_add_extscan_result(struct orinoco_private *priv,
@@ -158,7 +158,7 @@ void orinoco_add_extscan_result(struct orinoco_private *priv,
        cbss = cfg80211_inform_bss(wiphy, channel, bss->bssid, timestamp,
                                   capability, beacon_interval, ie, ie_len,
                                   signal, GFP_KERNEL);
-       cfg80211_put_bss(cbss);
+       cfg80211_put_bss(wiphy, cbss);
 }
 
 void orinoco_add_hostscan_results(struct orinoco_private *priv,
index abe1d039be814150d1815949e90f78b38573fa2d..fe2f272689aad8163966f15850577460c9c083e0 100644 (file)
@@ -2029,7 +2029,7 @@ static bool rndis_bss_info_update(struct usbnet *usbdev,
        bss = cfg80211_inform_bss(priv->wdev.wiphy, channel, bssid->mac,
                timestamp, capability, beacon_interval, ie, ie_len, signal,
                GFP_KERNEL);
-       cfg80211_put_bss(bss);
+       cfg80211_put_bss(priv->wdev.wiphy, bss);
 
        return (bss != NULL);
 }
@@ -2718,7 +2718,7 @@ static void rndis_wlan_craft_connected_bss(struct usbnet *usbdev, u8 *bssid,
        bss = cfg80211_inform_bss(priv->wdev.wiphy, channel, bssid,
                timestamp, capability, beacon_period, ie_buf, ie_len,
                signal, GFP_KERNEL);
-       cfg80211_put_bss(bss);
+       cfg80211_put_bss(priv->wdev.wiphy, bss);
 }
 
 /*
index 18c06a59c091b7bb1928cbac9038f5f0809a2288..a233f64ca22fa99c5c9288ba36ef5a3c7d8236e4 100644 (file)
@@ -424,7 +424,7 @@ int prism2_scan(struct wiphy *wiphy, struct cfg80211_scan_request *request)
                        goto exit;
                }
 
-               cfg80211_put_bss(bss);
+               cfg80211_put_bss(wiphy, bss);
        }
 
        if (result)
index 3ec70e1681d3c55ce703df4e3038c723ad888c27..691b347545cbf7a657e5a0b6451025cd63640b83 100644 (file)
@@ -3166,19 +3166,21 @@ cfg80211_get_ibss(struct wiphy *wiphy,
 
 /**
  * cfg80211_ref_bss - reference BSS struct
+ * @wiphy: the wiphy this BSS struct belongs to
  * @bss: the BSS struct to reference
  *
  * Increments the refcount of the given BSS struct.
  */
-void cfg80211_ref_bss(struct cfg80211_bss *bss);
+void cfg80211_ref_bss(struct wiphy *wiphy, struct cfg80211_bss *bss);
 
 /**
  * cfg80211_put_bss - unref BSS struct
+ * @wiphy: the wiphy this BSS struct belongs to
  * @bss: the BSS struct
  *
  * Decrements the refcount of the given BSS struct.
  */
-void cfg80211_put_bss(struct cfg80211_bss *bss);
+void cfg80211_put_bss(struct wiphy *wiphy, struct cfg80211_bss *bss);
 
 /**
  * cfg80211_unlink_bss - unlink BSS from internal data structures
index a54c8248e0e0240597d5e0d48b2b7bbc83c7ae18..71c55cc0f7b6274156ef91c6c0b817899896bc37 100644 (file)
@@ -228,7 +228,7 @@ static void __ieee80211_sta_join_ibss(struct ieee80211_sub_if_data *sdata,
 
        bss = cfg80211_inform_bss_frame(local->hw.wiphy, chan,
                                        mgmt, skb->len, 0, GFP_KERNEL);
-       cfg80211_put_bss(bss);
+       cfg80211_put_bss(local->hw.wiphy, bss);
        netif_carrier_on(sdata->dev);
        cfg80211_ibss_joined(sdata->dev, ifibss->bssid, GFP_KERNEL);
 }
@@ -1159,7 +1159,7 @@ int ieee80211_ibss_leave(struct ieee80211_sub_if_data *sdata)
 
                if (cbss) {
                        cfg80211_unlink_bss(local->hw.wiphy, cbss);
-                       cfg80211_put_bss(cbss);
+                       cfg80211_put_bss(local->hw.wiphy, cbss);
                }
        }
 
index 353b690900e991ba5c545a0feb8843cc836e8f07..15f2edd08a958daf8d99d1cb3e97ecc0e39a3ddb 100644 (file)
@@ -1934,7 +1934,7 @@ static void ieee80211_destroy_auth_data(struct ieee80211_sub_if_data *sdata,
                ieee80211_vif_release_channel(sdata);
        }
 
-       cfg80211_put_bss(auth_data->bss);
+       cfg80211_put_bss(sdata->local->hw.wiphy, auth_data->bss);
        kfree(auth_data);
        sdata->u.mgd.auth_data = NULL;
 }
@@ -2387,7 +2387,7 @@ ieee80211_rx_mgmt_assoc_resp(struct ieee80211_sub_if_data *sdata,
                if (!ieee80211_assoc_success(sdata, *bss, mgmt, len)) {
                        /* oops -- internal error -- send timeout for now */
                        ieee80211_destroy_assoc_data(sdata, false);
-                       cfg80211_put_bss(*bss);
+                       cfg80211_put_bss(sdata->local->hw.wiphy, *bss);
                        return RX_MGMT_CFG80211_ASSOC_TIMEOUT;
                }
                sdata_info(sdata, "associated\n");
@@ -3831,7 +3831,7 @@ int ieee80211_mgd_auth(struct ieee80211_sub_if_data *sdata,
        }
 
        /* hold our own reference */
-       cfg80211_ref_bss(auth_data->bss);
+       cfg80211_ref_bss(local->hw.wiphy, auth_data->bss);
        err = 0;
        goto out_unlock;
 
index 7f80f0a5026e34f8b25e8275ded853c1fe7d754f..400153f7f21fd5496496aeb0fb8a36ae28add46f 100644 (file)
@@ -34,7 +34,8 @@ void ieee80211_rx_bss_put(struct ieee80211_local *local,
 {
        if (!bss)
                return;
-       cfg80211_put_bss(container_of((void *)bss, struct cfg80211_bss, priv));
+       cfg80211_put_bss(local->hw.wiphy,
+                        container_of((void *)bss, struct cfg80211_bss, priv));
 }
 
 static bool is_uapsd_supported(struct ieee802_11_elems *elems)
index ce827242f3903ae15cca52ed98dcdcf4b5901886..f0a1bbe95cfffc0cee55114cc84bc8d4ed69ed37 100644 (file)
@@ -715,7 +715,7 @@ void cfg80211_dev_free(struct cfg80211_registered_device *rdev)
                kfree(reg);
        }
        list_for_each_entry_safe(scan, tmp, &rdev->bss_list, list)
-               cfg80211_put_bss(&scan->pub);
+               cfg80211_put_bss(&rdev->wiphy, &scan->pub);
        kfree(rdev);
 }
 
index 9b9551e4a6f9780a6b9fe6096949f9f86fd315ad..d80e47194d49ee7f9ead039b2fae2bc0fbcdb13a 100644 (file)
@@ -37,7 +37,7 @@ void __cfg80211_ibss_joined(struct net_device *dev, const u8 *bssid)
 
        if (wdev->current_bss) {
                cfg80211_unhold_bss(wdev->current_bss);
-               cfg80211_put_bss(&wdev->current_bss->pub);
+               cfg80211_put_bss(wdev->wiphy, &wdev->current_bss->pub);
        }
 
        cfg80211_hold_bss(bss_from_pub(bss));
@@ -182,7 +182,7 @@ static void __cfg80211_clear_ibss(struct net_device *dev, bool nowext)
 
        if (wdev->current_bss) {
                cfg80211_unhold_bss(wdev->current_bss);
-               cfg80211_put_bss(&wdev->current_bss->pub);
+               cfg80211_put_bss(wdev->wiphy, &wdev->current_bss->pub);
        }
 
        wdev->current_bss = NULL;
index fee9bf70efcf636dca3d00489e5ba545eaae7c6e..8e6920728c437b7e026275f37b0d1a646bf580c4 100644 (file)
@@ -58,7 +58,7 @@ void cfg80211_send_rx_assoc(struct net_device *dev, struct cfg80211_bss *bss,
         */
        if (status_code != WLAN_STATUS_SUCCESS && wdev->conn &&
            cfg80211_sme_failed_reassoc(wdev)) {
-               cfg80211_put_bss(bss);
+               cfg80211_put_bss(wiphy, bss);
                goto out;
        }
 
@@ -70,7 +70,7 @@ void cfg80211_send_rx_assoc(struct net_device *dev, struct cfg80211_bss *bss,
                 * do not call connect_result() now because the
                 * sme will schedule work that does it later.
                 */
-               cfg80211_put_bss(bss);
+               cfg80211_put_bss(wiphy, bss);
                goto out;
        }
 
@@ -108,7 +108,7 @@ void __cfg80211_send_deauth(struct net_device *dev,
        if (wdev->current_bss &&
            ether_addr_equal(wdev->current_bss->pub.bssid, bssid)) {
                cfg80211_unhold_bss(wdev->current_bss);
-               cfg80211_put_bss(&wdev->current_bss->pub);
+               cfg80211_put_bss(wiphy, &wdev->current_bss->pub);
                wdev->current_bss = NULL;
                was_current = true;
        }
@@ -164,7 +164,7 @@ void __cfg80211_send_disassoc(struct net_device *dev,
            ether_addr_equal(wdev->current_bss->pub.bssid, bssid)) {
                cfg80211_sme_disassoc(dev, wdev->current_bss);
                cfg80211_unhold_bss(wdev->current_bss);
-               cfg80211_put_bss(&wdev->current_bss->pub);
+               cfg80211_put_bss(wiphy, &wdev->current_bss->pub);
                wdev->current_bss = NULL;
        } else
                WARN_ON(1);
@@ -324,7 +324,7 @@ int __cfg80211_mlme_auth(struct cfg80211_registered_device *rdev,
        err = rdev_auth(rdev, dev, &req);
 
 out:
-       cfg80211_put_bss(req.bss);
+       cfg80211_put_bss(&rdev->wiphy, req.bss);
        return err;
 }
 
@@ -432,7 +432,7 @@ out:
        if (err) {
                if (was_connected)
                        wdev->sme_state = CFG80211_SME_CONNECTED;
-               cfg80211_put_bss(req.bss);
+               cfg80211_put_bss(&rdev->wiphy, req.bss);
        }
 
        return err;
@@ -572,7 +572,7 @@ void cfg80211_mlme_down(struct cfg80211_registered_device *rdev,
 
        if (wdev->current_bss) {
                cfg80211_unhold_bss(wdev->current_bss);
-               cfg80211_put_bss(&wdev->current_bss->pub);
+               cfg80211_put_bss(&rdev->wiphy, &wdev->current_bss->pub);
                wdev->current_bss = NULL;
        }
 }
index 36daacb31788b6bf35dc9aa1eb35b724b0c128ac..dacb44ac2f748f15d47ad9db56f848b8fc52ea2f 100644 (file)
@@ -818,7 +818,7 @@ cfg80211_inform_bss_frame(struct wiphy *wiphy,
 }
 EXPORT_SYMBOL(cfg80211_inform_bss_frame);
 
-void cfg80211_ref_bss(struct cfg80211_bss *pub)
+void cfg80211_ref_bss(struct wiphy *wiphy, struct cfg80211_bss *pub)
 {
        struct cfg80211_internal_bss *bss;
 
@@ -830,7 +830,7 @@ void cfg80211_ref_bss(struct cfg80211_bss *pub)
 }
 EXPORT_SYMBOL(cfg80211_ref_bss);
 
-void cfg80211_put_bss(struct cfg80211_bss *pub)
+void cfg80211_put_bss(struct wiphy *wiphy, struct cfg80211_bss *pub)
 {
        struct cfg80211_internal_bss *bss;
 
index a825dfe12cf74bfad50ea500b5a96f9018a11a19..f432bd3755b19f0d865b1b2e9f2a132890f3b6a3 100644 (file)
@@ -301,7 +301,7 @@ static void __cfg80211_sme_scan_done(struct net_device *dev)
 
        bss = cfg80211_get_conn_bss(wdev);
        if (bss) {
-               cfg80211_put_bss(bss);
+               cfg80211_put_bss(&rdev->wiphy, bss);
        } else {
                /* not found */
                if (wdev->conn->state == CFG80211_CONN_SCAN_AGAIN)
@@ -464,7 +464,7 @@ void __cfg80211_connect_result(struct net_device *dev, const u8 *bssid,
 
        if (wdev->current_bss) {
                cfg80211_unhold_bss(wdev->current_bss);
-               cfg80211_put_bss(&wdev->current_bss->pub);
+               cfg80211_put_bss(wdev->wiphy, &wdev->current_bss->pub);
                wdev->current_bss = NULL;
        }
 
@@ -480,7 +480,7 @@ void __cfg80211_connect_result(struct net_device *dev, const u8 *bssid,
                kfree(wdev->connect_keys);
                wdev->connect_keys = NULL;
                wdev->ssid_len = 0;
-               cfg80211_put_bss(bss);
+               cfg80211_put_bss(wdev->wiphy, bss);
                return;
        }
 
@@ -586,7 +586,7 @@ void __cfg80211_roamed(struct wireless_dev *wdev,
        }
 
        cfg80211_unhold_bss(wdev->current_bss);
-       cfg80211_put_bss(&wdev->current_bss->pub);
+       cfg80211_put_bss(wdev->wiphy, &wdev->current_bss->pub);
        wdev->current_bss = NULL;
 
        cfg80211_hold_bss(bss_from_pub(bss));
@@ -621,7 +621,7 @@ void __cfg80211_roamed(struct wireless_dev *wdev,
 
        return;
 out:
-       cfg80211_put_bss(bss);
+       cfg80211_put_bss(wdev->wiphy, bss);
 }
 
 void cfg80211_roamed(struct net_device *dev,
@@ -663,7 +663,7 @@ void cfg80211_roamed_bss(struct net_device *dev,
 
        ev = kzalloc(sizeof(*ev) + req_ie_len + resp_ie_len, gfp);
        if (!ev) {
-               cfg80211_put_bss(bss);
+               cfg80211_put_bss(wdev->wiphy, bss);
                return;
        }
 
@@ -704,7 +704,7 @@ void __cfg80211_disconnected(struct net_device *dev, const u8 *ie,
 
        if (wdev->current_bss) {
                cfg80211_unhold_bss(wdev->current_bss);
-               cfg80211_put_bss(&wdev->current_bss->pub);
+               cfg80211_put_bss(wdev->wiphy, &wdev->current_bss->pub);
        }
 
        wdev->current_bss = NULL;
@@ -875,7 +875,7 @@ int __cfg80211_connect(struct cfg80211_registered_device *rdev,
                if (bss) {
                        wdev->conn->state = CFG80211_CONN_AUTHENTICATE_NEXT;
                        err = cfg80211_conn_do_work(wdev);
-                       cfg80211_put_bss(bss);
+                       cfg80211_put_bss(wdev->wiphy, bss);
                } else {
                        /* otherwise we'll need to scan for the AP first */
                        err = cfg80211_conn_scan(wdev);