int nmode = 0;
int bw_cap = 0;
int index = 0;
+ bool rollback_lock = false;
WL_DBG(("Entry"));
- if (wl == NULL)
+ if (wl == NULL) {
wl = wlcfg_drv_priv;
+ mutex_lock(&wl->usr_sync);
+ rollback_lock = true;
+ }
dev = wl_to_prmry_ndev(wl);
memset(bandlist, 0, sizeof(bandlist));
sizeof(bandlist), false);
if (unlikely(err)) {
WL_ERR(("error read bandlist (%d)\n", err));
- return err;
+ goto end_bands;
}
wiphy = wl_to_wiphy(wl);
nband = bandlist[0];
if (err) {
WL_ERR(("wl_construct_reginfo() fails err=%d\n", err));
if (err != BCME_UNSUPPORTED)
- return err;
+ goto end_bands;
/* Ignore error if "chanspecs" command is not supported */
err = 0;
}
}
wiphy_apply_custom_regulatory(wiphy, &brcm_regdom);
+end_bands:
+ if (rollback_lock)
+ mutex_unlock(&wl->usr_sync);
return err;
}