summaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath
diff options
context:
space:
mode:
authorRaja Mani <rmani@qca.qualcomm.com>2012-09-21 15:08:55 +0530
committerKalle Valo <kvalo@qca.qualcomm.com>2012-10-24 11:49:50 +0300
commit363f149ce37bea91069177eab691111b242bfe73 (patch)
tree1cfe860c39ed6bf66ae050097d41d2f0dfc7ebba /drivers/net/wireless/ath
parentd54601b92fbde2a7021a844e1373ba8c778cc0a3 (diff)
downloadblackbird-op-linux-363f149ce37bea91069177eab691111b242bfe73.tar.gz
blackbird-op-linux-363f149ce37bea91069177eab691111b242bfe73.zip
ath6kl: Check for valid endpoint ID values in ath6kl_control_tx()
It's safe to check endpoint id values before it get really used. Found this on code review. Signed-off-by: Raja Mani <rmani@qca.qualcomm.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
Diffstat (limited to 'drivers/net/wireless/ath')
-rw-r--r--drivers/net/wireless/ath/ath6kl/txrx.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/net/wireless/ath/ath6kl/txrx.c b/drivers/net/wireless/ath/ath6kl/txrx.c
index efee590a234a..cf4380d573c4 100644
--- a/drivers/net/wireless/ath/ath6kl/txrx.c
+++ b/drivers/net/wireless/ath/ath6kl/txrx.c
@@ -293,6 +293,12 @@ int ath6kl_control_tx(void *devt, struct sk_buff *skb,
return -EACCES;
}
+ if (WARN_ON_ONCE(eid == ENDPOINT_UNUSED ||
+ eid >= ENDPOINT_MAX)) {
+ status = -EINVAL;
+ goto fail_ctrl_tx;
+ }
+
spin_lock_bh(&ar->lock);
ath6kl_dbg(ATH6KL_DBG_WLAN_TX,
OpenPOWER on IntegriCloud