mirror of
https://github.com/espressif/esp-idf
synced 2025-03-10 09:39:10 -04:00
esp32: fix interrupt list insert issue
If the allocated interrupt list is not empty and the new item will be inserted as the header of the list, insert_vector_desc() causes crash because pre is null. This commit fix this issue.
This commit is contained in:
parent
adc3315677
commit
1c81e4be60
@ -194,10 +194,10 @@ static void insert_vector_desc(vector_desc_t *to_insert)
|
|||||||
prev=vd;
|
prev=vd;
|
||||||
vd=vd->next;
|
vd=vd->next;
|
||||||
}
|
}
|
||||||
if (vd==NULL && prev==NULL) {
|
if ((vector_desc_head==NULL) || (prev==NULL)) {
|
||||||
//First item
|
//First item
|
||||||
|
to_insert->next = vd;
|
||||||
vector_desc_head=to_insert;
|
vector_desc_head=to_insert;
|
||||||
vector_desc_head->next=NULL;
|
|
||||||
} else {
|
} else {
|
||||||
prev->next=to_insert;
|
prev->next=to_insert;
|
||||||
to_insert->next=vd;
|
to_insert->next=vd;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user