Within the Genode C API for USB host drivers: when processing USB requests a for_each function is used to loop over the open sessions. Due to the fact that certain USB requests (control) may block in the Linux driver ported code, it happens that after de-blocking the next pointer that was cached in the for_each loop is actually invalid.
To circumvent this behaviour, we can replace occurrences of for_each in the USB C API code where actually an apply for one fitting instance is needed. Such an additional method does not need to cache the next pointer, and can be used mostly. Only few occurrences of for_each are actually necessary (like destruction use cases), which should not call potentially blocking Linux code.
Within the Genode C API for USB host drivers: when processing USB requests a
for_each
function is used to loop over the open sessions. Due to the fact that certain USB requests (control) may block in the Linux driver ported code, it happens that after de-blocking the next pointer that was cached in the for_each loop is actually invalid. To circumvent this behaviour, we can replace occurrences offor_each
in the USB C API code where actually anapply
for one fitting instance is needed. Such an additional method does not need to cache the next pointer, and can be used mostly. Only few occurrences offor_each
are actually necessary (like destruction use cases), which should not call potentially blocking Linux code.