⬢ DragonFlyBSD Kernel Audit
DF-5620 / fix.diff
← back to finding ↓ download raw
diff --git a/sys/platform/pc64/acpica/acpi_cstate_machdep.c b/sys/platform/pc64/acpica/acpi_cstate_machdep.c
--- a/sys/platform/pc64/acpica/acpi_cstate_machdep.c
+++ b/sys/platform/pc64/acpica/acpi_cstate_machdep.c
@@ -128,7 +140,6 @@
 acpi_cst_cx_mwait_setup(struct acpi_cst_cx *cx)
 {
 	uint32_t eax_hint;
-	int error;
 
 	if (bootverbose) {
 		kprintf("C%d: BitWidth(vendor) %d, BitOffset(class) %d, "
@@ -160,15 +171,13 @@
 
 	if (!cpu_mwait_hint_valid(eax_hint)) {
 		kprintf("C%d: invalid mwait hint 0x%08x\n", cx->type, eax_hint);
-		error = EINVAL;
-		goto done;
+		/* Rejected descriptor: no global side effects. */
+		return EINVAL;
 	}
 
 	cx->md_arg0 = eax_hint;
 	cx->enter = acpi_cst_cx_mwait_enter;
-	error = 0;
 
-done:
 	if ((cx->gas.AccessWidth & ACPI_GAS_INTEL_ARG1_BM_STS) == 0 &&
 	    !acpi_cst_force_bmsts) {
 		cpu_mwait_cx_no_bmsts();
@@ -189,7 +198,7 @@
 			cpu_mwait_cx_no_bmarb();
 	}
 
-	return error;
+	return 0;
 }
 
 static void