Check uCH is not more than CB_MAX_CHANNEL_24G(14) on rates RATE_1M to RATE_11M

Return false as the call is invalid as these rates do not exist
above channel 14.

Reported-by: Dan Carpenter <dan.carpen...@oracle.com>
Cc: Dan Carpenter <dan.carpen...@oracle.com>
Signed-off-by: Malcolm Priestley <tvbox...@gmail.com>
---
 drivers/staging/vt6655/rf.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/staging/vt6655/rf.c b/drivers/staging/vt6655/rf.c
index 27841aa..a6eabde 100644
--- a/drivers/staging/vt6655/rf.c
+++ b/drivers/staging/vt6655/rf.c
@@ -788,6 +788,9 @@ bool RFbSetPower(
        case RATE_2M:
        case RATE_5M:
        case RATE_11M:
+               if (uCH > CB_MAX_CHANNEL_24G)
+                       return false;
+
                byPwr = priv->abyCCKPwrTbl[uCH];
                byPwrdBm = priv->abyCCKDefaultPwr[uCH];
                break;
-- 
2.1.0

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to