mirror of
https://github.com/Mathewnd/Astral.git
synced 2026-10-30 05: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) {
|
void acpi_initdevice(void) {
|
||||||
__assert(devfs_register(&acpiops, "acpi", V_TYPE_CHDEV, DEV_MAJOR_ACPI, 0, 0600, NULL) == 0);
|
__assert(devfs_register(&acpiops, "acpi", V_TYPE_CHDEV, DEV_MAJOR_ACPI, 0, 0600, NULL) == 0);
|
||||||
__assert(ringbuffer_init(&ringbuffer, 64) == 0);
|
__assert(ringbuffer_init(&ringbuffer, 64) == 0);
|
||||||
|
MUTEX_INIT(&mutex);
|
||||||
POLL_INITHEADER(&pollheader);
|
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);
|
error = poll_dowait(&desc, effectivetimeout);
|
||||||
|
|
||||||
|
poll_leave(&desc);
|
||||||
|
poll_destroydesc(&desc);
|
||||||
|
|
||||||
if (error == 0 && (desc.event == NULL || (desc.event && desc.event->revents == 0))) {
|
if (error == 0 && (desc.event == NULL || (desc.event && desc.event->revents == 0))) {
|
||||||
// timed out!
|
// timed out!
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
poll_leave(&desc);
|
|
||||||
poll_destroydesc(&desc);
|
|
||||||
|
|
||||||
if (error)
|
if (error)
|
||||||
goto leave;
|
goto leave;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user