mirror of
https://github.com/Mathewnd/Astral.git
synced 2026-10-27 20:58:22 +00:00
acpi: fix use of unitialized mutex
This commit is contained in:
@@ -112,5 +112,6 @@ static devops_t acpiops = {
|
||||
void acpi_initdevice(void) {
|
||||
__assert(devfs_register(&acpiops, "acpi", V_TYPE_CHDEV, DEV_MAJOR_ACPI, 0, 0600, NULL) == 0);
|
||||
__assert(ringbuffer_init(&ringbuffer, 64) == 0);
|
||||
MUTEX_INIT(&mutex);
|
||||
POLL_INITHEADER(&pollheader);
|
||||
}
|
||||
|
||||
+4
-3
@@ -256,14 +256,15 @@ static int read(int minor, iovec_iterator_t *iovec_iterator, size_t size, uintma
|
||||
}
|
||||
|
||||
error = poll_dowait(&desc, effectivetimeout);
|
||||
|
||||
poll_leave(&desc);
|
||||
poll_destroydesc(&desc);
|
||||
|
||||
if (error == 0 && (desc.event == NULL || (desc.event && desc.event->revents == 0))) {
|
||||
// timed out!
|
||||
break;
|
||||
}
|
||||
|
||||
poll_leave(&desc);
|
||||
poll_destroydesc(&desc);
|
||||
|
||||
if (error)
|
||||
goto leave;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user