rsta = rsi_find_sta(common, sta->addr);
if (!rsta) {
rsi_dbg(ERR_ZONE, "No station mapped\n");
- return 0;
+ status = 0;
+ goto unlock;
}
sta_id = rsta->sta_id;
}
break;
}
+unlock:
mutex_unlock(&common->mutex);
return status;
}
struct rsi_common *common = adapter->priv;
bool sta_exist = false;
struct rsi_sta *rsta;
+ int status = 0;
rsi_dbg(INFO_ZONE, "Station Add: %pM\n", sta->addr);
/* Check if max stations reached */
if (common->num_stations >= common->max_stations) {
rsi_dbg(ERR_ZONE, "Reject: Max Stations exists\n");
- mutex_unlock(&common->mutex);
- return -EOPNOTSUPP;
+ status = -EOPNOTSUPP;
+ goto unlock;
}
for (cnt = 0; cnt < common->max_stations; cnt++) {
rsta = &common->stations[cnt];
rsi_dbg(ERR_ZONE,
"%s: Some problem reaching here...\n",
__func__);
- return -EINVAL;
+ status = -EINVAL;
+ goto unlock;
}
rsta = &common->stations[sta_idx];
rsta->sta = sta;
}
}
+unlock:
mutex_unlock(&common->mutex);
- return 0;
+ return status;
}
/**