Skip to content

Commit

Permalink
eeepc-laptop: don't assume get_acpi succeeds
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Frans Klaver authored and Darren Hart committed Nov 19, 2014
1 parent 148a5dd commit efef872
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions drivers/platform/x86/eeepc-laptop.c
Original file line number Diff line number Diff line change
Expand Up @@ -917,15 +917,16 @@ 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
* during suspend. Normally it restores it on resume, but
* we should kick it ourselves in case hibernation is aborted.
*/
wlan = get_acpi(eeepc, CM_ASL_WLAN);
set_acpi(eeepc, CM_ASL_WLAN, wlan);
if (wlan >= 0)
set_acpi(eeepc, CM_ASL_WLAN, wlan);
}

return 0;
Expand Down

0 comments on commit efef872

Please sign in to comment.