Check malloc succeeded in pic_create, with M_NOWAIT it may return NULL.
Obtained from: ABT Systems Ltd Sponsored by: The FreeBSD Foundation
This commit is contained in:
parent
0754e66c54
commit
b48c608386
@ -871,6 +871,10 @@ pic_create(device_t dev, intptr_t xref)
|
||||
return (pic);
|
||||
}
|
||||
pic = malloc(sizeof(*pic), M_INTRNG, M_NOWAIT | M_ZERO);
|
||||
if (pic == NULL) {
|
||||
mtx_unlock(&pic_list_lock);
|
||||
return (NULL);
|
||||
}
|
||||
pic->pic_xref = xref;
|
||||
pic->pic_dev = dev;
|
||||
SLIST_INSERT_HEAD(&pic_list, pic, pic_next);
|
||||
|
Loading…
Reference in New Issue
Block a user