tx_power.c: fix potential array out-of-bounds access
This commit is contained in:
parent
68b9b376cf
commit
e0e9b30f5c
|
@ -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 */
|
||||
|
|
Loading…
Reference in New Issue