Skip to contentSkip to conversation

ACPI sleep: stupid bug reintroduced

PATCH Pavel Machek 1 participant 1 message Oct 1, 2002 ACPI

lore
Share & tools
lore
#0 lore raw

Hi!

There's extremely stupid bug in sleep.c -- it will only alow user to enter *unsupported* states. What's even worse that I remember fixing that once before, and *it was merged to mainline*.

Please, really merge it to all copies so it is not reintroduced again.

[Oh, at it also makes S4 transition fail when SWSUSP support is not there.]

Pavel

drivers/acpi/sleep.c +5 -2
@@ -329,8 +329,8 @@
 	state_string[count] = '\0';
 	
 	state = simple_strtoul(state_string, NULL, 0);
-	
-	if (sleep_states[state])
+
+	if (!sleep_states[state])
 		return_VALUE(-ENODEV);
 
 #ifdef CONFIG_SOFTWARE_SUSPEND
@@ -338,7 +338,10 @@
 		software_suspend();
 		return_VALUE(count);
 	}
+#else
+	return_VALUE(-ENODEV);
 #endif
+
 	status = acpi_suspend(state);
 
 	if (ACPI_FAILURE(status))
Signature · 2 lines
Worst form of spam? Adding advertisment signatures ala sourceforge.net.
What goes next? Inserting advertisment *into* email?