decrement channel by one and check array bound. Signed-off-by: Malcolm Priestley <tvboxspy@xxxxxxxxx> --- drivers/staging/vt6656/rf.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/staging/vt6656/rf.c b/drivers/staging/vt6656/rf.c index 971f844..4124131 100644 --- a/drivers/staging/vt6656/rf.c +++ b/drivers/staging/vt6656/rf.c @@ -744,7 +744,10 @@ int vnt_rf_setpower(struct vnt_private *priv, u32 rate, u32 channel) case RATE_2M: case RATE_5M: case RATE_11M: - power = priv->abyCCKPwrTbl[channel-1]; + channel--; + + if (channel < sizeof(priv->abyCCKPwrTbl)) + power = priv->abyCCKPwrTbl[channel]; break; case RATE_6M: case RATE_9M: -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html