From: Ben Greear The hope is that this would allow cleanup code to run properly in case this fails halfway through. Signed-off-by: Ben Greear --- net/mac80211/sta_info.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/net/mac80211/sta_info.c b/net/mac80211/sta_info.c index 4259e9c13ed7..ad211c714dbb 100644 --- a/net/mac80211/sta_info.c +++ b/net/mac80211/sta_info.c @@ -836,18 +836,18 @@ static int sta_info_insert_drv_state(struct ieee80211_local *local, err = drv_sta_state(local, sdata, sta, state, state + 1); if (err) break; - } - - if (!err) { /* * Drivers using legacy sta_add/sta_remove callbacks only * get uploaded set to true after sta_add is called. + * We are at least somewhat added now. */ if (!local->ops->sta_add) sta->uploaded = true; - return 0; } + if (!err) + return 0; + if (sdata->vif.type == NL80211_IFTYPE_ADHOC) { sdata_info(sdata, "failed to move IBSS STA %pM to state %d (%d) - keeping it anyway\n", -- 2.42.0