mirror of
https://github.com/apache/nuttx.git
synced 2026-08-01 20:28:58 +00:00
drivers: 1wire: Fix DS2XXX device type bounds
EEPROM_DS_COUNT is the number of supported DS2XXX device types and is used as the size of the EEPROM geometry tables. Reject it before storing the device type for later table indexing. Generated-by: OpenAI Codex Signed-off-by: aineoae86-sys <ai.neo.ae86@gmail.com>
This commit is contained in:
parent
a2b8d15041
commit
bc764dc9bd
1 changed files with 1 additions and 1 deletions
|
|
@ -793,7 +793,7 @@ int ds2xxx_initialize(FAR struct onewire_dev_s *dev,
|
|||
{
|
||||
FAR struct ds2xxx_dev_s *priv;
|
||||
|
||||
if (devtype < 0 || devtype > EEPROM_DS_COUNT)
|
||||
if (devtype < 0 || devtype >= EEPROM_DS_COUNT)
|
||||
{
|
||||
return -EINVAL;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue