Skip to content

Commit

Permalink
ath6kl: Check for valid endpoint ID values in ath6kl_control_tx()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Raja Mani authored and Kalle Valo committed Oct 24, 2012
1 parent d54601b commit 363f149
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions drivers/net/wireless/ath/ath6kl/txrx.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 363f149

Please sign in to comment.