mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2024-12-29 04:50:03 +01:00
cpu/kinetis_common: fixed null ptr ref in gpio.c
This commit is contained in:
parent
5cac36d5b3
commit
cfcf951b9d
@ -326,12 +326,12 @@ void gpio_irq_enable(gpio_t dev)
|
|||||||
mutex_lock(&int_config_lock);
|
mutex_lock(&int_config_lock);
|
||||||
/* Search for the given pin in the port's interrupt configuration */
|
/* Search for the given pin in the port's interrupt configuration */
|
||||||
LL_SEARCH_SCALAR(gpio_interrupts[_port_num(dev)], entry, pin, pin_number);
|
LL_SEARCH_SCALAR(gpio_interrupts[_port_num(dev)], entry, pin, pin_number);
|
||||||
uint32_t irqc = entry->irqc;
|
|
||||||
mutex_unlock(&int_config_lock);
|
mutex_unlock(&int_config_lock);
|
||||||
if (entry == NULL) {
|
if (entry == NULL) {
|
||||||
/* Pin has not been configured for interrupts */
|
/* Pin has not been configured for interrupts */
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
uint32_t irqc = entry->irqc;
|
||||||
port->PCR[pin_number] &= ~(PORT_PCR_IRQC_MASK);
|
port->PCR[pin_number] &= ~(PORT_PCR_IRQC_MASK);
|
||||||
port->PCR[pin_number] |= irqc;
|
port->PCR[pin_number] |= irqc;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user