From 0b37b86d68492cf371e4ddc9550db28186092b7f Mon Sep 17 00:00:00 2001 From: aineoae86-sys Date: Mon, 6 Jul 2026 02:51:45 +0800 Subject: [PATCH] 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 --- drivers/1wire/1wire_ds2xxx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/1wire/1wire_ds2xxx.c b/drivers/1wire/1wire_ds2xxx.c index d7438a0c747..980e595921f 100644 --- a/drivers/1wire/1wire_ds2xxx.c +++ b/drivers/1wire/1wire_ds2xxx.c @@ -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; }