power: supply: sc8551: Handling data out-of-bounds in Code

Change-Id: I3a2671b5dc2976d1dc030a21734cb425a72edad1
Signed-off-by: Shengfei Xu <xsf@rock-chips.com>
This commit is contained in:
Shengfei Xu
2025-03-05 18:06:29 +08:00
committed by Tao Huang
parent 62ee65392c
commit 4b1b147d3f

View File

@@ -1191,7 +1191,7 @@ static int sc8551_set_adc_scanrate(struct sc8551 *sc, bool oneshot)
static int sc8551_get_adc_data(struct sc8551 *sc, int channel, int *result)
{
u8 val_l = 0, val_h = 0;
u16 val = 0;
u32 val = 0;
int ret = 0;
if (channel >= ADC_MAX_NUM)