From: Raja Mani Date: Fri, 21 Sep 2012 09:38:55 +0000 (+0530) Subject: ath6kl: Check for valid endpoint ID values in ath6kl_control_tx() X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=363f149ce37bea91069177eab691111b242bfe73;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git 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 Signed-off-by: Kalle Valo --- 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,