Skip to content

Commit 836cf37

Browse files
ljd42kartben
authored andcommitted
driver: gpio_ite_it8xxx2_v2: fix untrusted bound loop
Coverity is reporting a possible untrusted loop bound, caused by accessing num_pins through a tainted pointer. Use explicit type cast to keep coverity happy. CID: 347195 Signed-off-by: Loic Domaigne <tech@domaigne.com>
1 parent 4f3523d commit 836cf37

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

drivers/gpio/gpio_ite_it8xxx2_v2.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -375,9 +375,9 @@ static int gpio_ite_manage_callback(const struct device *dev,
375375

376376
static void gpio_ite_isr(const void *arg)
377377
{
378-
const struct device *dev = arg;
379-
const struct gpio_ite_cfg *gpio_config = dev->config;
380-
struct gpio_ite_data *data = dev->data;
378+
const struct device *dev = (const struct device *)arg;
379+
const struct gpio_ite_cfg *gpio_config = (const struct gpio_ite_cfg *)dev->config;
380+
struct gpio_ite_data *data = (struct gpio_ite_data *)dev->data;
381381
uint8_t irq = ite_intc_get_irq_num();
382382
uint8_t num_pins = gpio_config->num_pins;
383383
uint8_t pin;

0 commit comments

Comments
 (0)