boards: arm: stm32: fix out of bounds access
Fix an out of bounds access when `CONFIG_SOC_SERIES_STM32F1X` is enabled. Signed-off-by: Noah Pendleton <noah.pendleton@gmail.com>
This commit is contained in:
parent
959f3d8d7f
commit
d68de09c0f
1 changed files with 5 additions and 1 deletions
|
@ -246,10 +246,14 @@ static int start_read(struct device *dev, const struct adc_sequence *sequence)
|
|||
case 10:
|
||||
resolution = table_resolution[2];
|
||||
break;
|
||||
#endif
|
||||
case 12:
|
||||
resolution = table_resolution[3];
|
||||
break;
|
||||
#else
|
||||
case 12:
|
||||
resolution = table_resolution[0];
|
||||
break;
|
||||
#endif
|
||||
default:
|
||||
LOG_ERR("Invalid resolution");
|
||||
return -EINVAL;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue