summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorMaya Erez <qca_merez@qca.qualcomm.com>2016-03-09 09:39:34 +0200
committerJeevan Shriram <jshriram@codeaurora.org>2016-04-05 11:36:00 -0700
commitba419d225fb2c119601aae8483544a1f62828919 (patch)
treef751577691d77c546ba087e8a4b8dc8e1c958974 /drivers
parentc59176cbb77935f3be95cfedab0030be30054adc (diff)
wil6210: AP: prevent connecting to already connected station
wmi_evt_connect doesn't check if the connect event is received for an already connected station. This can lead to memory leak as a new vring is allocated without freeing the previously allocated vring and to unexpected behavior of nl80211 layer due to unexpected notification of a new station. Add a check in wmi_evt_connect in AP mode to verify that the requested CID is not associated to an already connected station. Change-Id: I0e438d437154b1b47c572218072a736da5013c80 Signed-off-by: Maya Erez <qca_merez@qca.qualcomm.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com> Git-commit: 3d287fb398c03189a1394778162f6404e4d44ad2 Git-repo: https://github.com/kvalo/ath.git CRs-Fixed: 982882 Signed-off-by: Maya Erez <merez@codeaurora.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/wireless/ath/wil6210/wmi.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/net/wireless/ath/wil6210/wmi.c b/drivers/net/wireless/ath/wil6210/wmi.c
index 493e721c4fa7..fb090350df6d 100644
--- a/drivers/net/wireless/ath/wil6210/wmi.c
+++ b/drivers/net/wireless/ath/wil6210/wmi.c
@@ -487,6 +487,14 @@ static void wmi_evt_connect(struct wil6210_priv *wil, int id, void *d, int len)
return;
}
del_timer_sync(&wil->connect_timer);
+ } else if ((wdev->iftype == NL80211_IFTYPE_AP) ||
+ (wdev->iftype == NL80211_IFTYPE_P2P_GO)) {
+ if (wil->sta[evt->cid].status != wil_sta_unused) {
+ wil_err(wil, "%s: AP: Invalid status %d for CID %d\n",
+ __func__, wil->sta[evt->cid].status, evt->cid);
+ mutex_unlock(&wil->mutex);
+ return;
+ }
}
/* FIXME FW can transmit only ucast frames to peer */