tx_power.c: fix potential array out-of-bounds access

This commit is contained in:
Harald Welte 2014-08-25 10:05:31 +02:00
parent 68b9b376cf
commit e0e9b30f5c
1 changed files with 1 additions and 1 deletions

View File

@ -33,7 +33,7 @@
static int get_pa_drive_level_mdBm(const struct power_amp *pa,
int desired_p_out_mdBm, unsigned int arfcn)
{
if (arfcn > ARRAY_SIZE(pa->calib.gain_mdB))
if (arfcn >= ARRAY_SIZE(pa->calib.gain_mdB))
return INT_MIN;
/* FIXME: temperature compensation */