Commit 4ea03443 authored by Karthikeyan Periyasamy's avatar Karthikeyan Periyasamy Committed by Kalle Valo
Browse files

ath11k: fix error routine when fallback of add interface fails



When there is an error in add interface process from
ath11k_mac_set_kickout(), the code attempts to handle a
fallback for add_interface. When this fallback succeeds, the
driver returns zero rather than error code. This leads to
success for the non created VAP. In cleanup, driver gets
remove interface callback for the non created VAP and
proceeds to self peer delete request which leads to FW assert.
Since it was already deleted on the fallback of add interface,
return the actual error code instead of fallback return code.

Tested-on: IPQ8074 hw2.0 AHB WLAN.HK.2.5.0.1-00729-QCAHKSWPL_SILICONZ-3 v2

Signed-off-by: default avatarKarthikeyan Periyasamy <quic_periyasa@quicinc.com>
Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/1636558557-2874-1-git-send-email-quic_periyasa@quicinc.com
parent 85f36923
Loading
Loading
Loading
Loading
+7 −7
Original line number Original line Diff line number Diff line
@@ -5613,7 +5613,7 @@ static int ath11k_mac_op_add_interface(struct ieee80211_hw *hw,
	u32 param_id, param_value;
	u32 param_id, param_value;
	u16 nss;
	u16 nss;
	int i;
	int i;
	int ret;
	int ret, fbret;
	int bit;
	int bit;


	vif->driver_flags |= IEEE80211_VIF_SUPPORTS_UAPSD;
	vif->driver_flags |= IEEE80211_VIF_SUPPORTS_UAPSD;
@@ -5816,17 +5816,17 @@ static int ath11k_mac_op_add_interface(struct ieee80211_hw *hw,
	if (arvif->vdev_type == WMI_VDEV_TYPE_AP) {
	if (arvif->vdev_type == WMI_VDEV_TYPE_AP) {
		reinit_completion(&ar->peer_delete_done);
		reinit_completion(&ar->peer_delete_done);


		ret = ath11k_wmi_send_peer_delete_cmd(ar, vif->addr,
		fbret = ath11k_wmi_send_peer_delete_cmd(ar, vif->addr,
							arvif->vdev_id);
							arvif->vdev_id);
		if (ret) {
		if (fbret) {
			ath11k_warn(ar->ab, "failed to delete peer vdev_id %d addr %pM\n",
			ath11k_warn(ar->ab, "failed to delete peer vdev_id %d addr %pM\n",
				    arvif->vdev_id, vif->addr);
				    arvif->vdev_id, vif->addr);
			goto err;
			goto err;
		}
		}


		ret = ath11k_wait_for_peer_delete_done(ar, arvif->vdev_id,
		fbret = ath11k_wait_for_peer_delete_done(ar, arvif->vdev_id,
							 vif->addr);
							 vif->addr);
		if (ret)
		if (fbret)
			goto err;
			goto err;


		ar->num_peers--;
		ar->num_peers--;