Skip to content

Commit 816e242

Browse files
Update bsp/Infineon/libraries/HAL_Drivers/drv_gpio.c
Co-authored-by: Copilot <[email protected]>
1 parent 6d0292b commit 816e242

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

bsp/Infineon/libraries/HAL_Drivers/drv_gpio.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -358,6 +358,11 @@ static rt_err_t ifx_pin_irq_enable(struct rt_device *device, rt_base_t pin,
358358

359359
#if !defined(COMPONENT_CAT1C)
360360
IRQn_Type irqn = irqmap->irqno;
361+
if (irqn < 0 || irqn >= PIN_IFXPORT_MAX)
362+
{
363+
rt_hw_interrupt_enable(level);
364+
return -RT_EINVAL;
365+
}
361366
_cyhal_irq_disable(irqn);
362367
#endif
363368
rt_hw_interrupt_enable(level);

0 commit comments

Comments
 (0)