2
0
mirror of https://github.com/edk2-porting/linux-next.git synced 2024-12-17 01:34:00 +08:00

eeepc-laptop: don't assume get_acpi succeeds

In eeepc_hotk_thaw, we assume that get_acpi() will effectively return a
bool. However, it is possible that get_acpi() returns an error instead.
We should not be writing error values to the ACPI device, even though
it's quite possible that we couldn't contact the ACPI device in the
first place.

Signed-off-by: Frans Klaver <fransklaver@gmail.com>
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
This commit is contained in:
Frans Klaver 2014-10-22 21:12:43 +02:00 committed by Darren Hart
parent 148a5dd5cc
commit efef87296e

View File

@ -917,7 +917,7 @@ static int eeepc_hotk_thaw(struct device *device)
struct eeepc_laptop *eeepc = dev_get_drvdata(device);
if (eeepc->wlan_rfkill) {
bool wlan;
int wlan;
/*
* Work around bios bug - acpi _PTS turns off the wireless led
@ -925,6 +925,7 @@ static int eeepc_hotk_thaw(struct device *device)
* we should kick it ourselves in case hibernation is aborted.
*/
wlan = get_acpi(eeepc, CM_ASL_WLAN);
if (wlan >= 0)
set_acpi(eeepc, CM_ASL_WLAN, wlan);
}