aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/platform/x86
diff options
context:
space:
mode:
authorFrans Klaver <fransklaver@gmail.com>2014-10-22 15:12:43 -0400
committerDarren Hart <dvhart@linux.intel.com>2014-11-19 12:07:08 -0500
commitefef87296eb6bf7b9a21b16f81a6ddd5ee33b513 (patch)
tree619c1e07558a4ac77f2da5f36946e2b401504080 /drivers/platform/x86
parent148a5dd5ccc25581b44a38079128f49e47353713 (diff)
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>
Diffstat (limited to 'drivers/platform/x86')
-rw-r--r--drivers/platform/x86/eeepc-laptop.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/platform/x86/eeepc-laptop.c b/drivers/platform/x86/eeepc-laptop.c
index e87c1346e1d4..8f9dc9cf5994 100644
--- a/drivers/platform/x86/eeepc-laptop.c
+++ b/drivers/platform/x86/eeepc-laptop.c
@@ -917,7 +917,7 @@ static int eeepc_hotk_thaw(struct device *device)
917 struct eeepc_laptop *eeepc = dev_get_drvdata(device); 917 struct eeepc_laptop *eeepc = dev_get_drvdata(device);
918 918
919 if (eeepc->wlan_rfkill) { 919 if (eeepc->wlan_rfkill) {
920 bool wlan; 920 int wlan;
921 921
922 /* 922 /*
923 * Work around bios bug - acpi _PTS turns off the wireless led 923 * Work around bios bug - acpi _PTS turns off the wireless led
@@ -925,7 +925,8 @@ static int eeepc_hotk_thaw(struct device *device)
925 * we should kick it ourselves in case hibernation is aborted. 925 * we should kick it ourselves in case hibernation is aborted.
926 */ 926 */
927 wlan = get_acpi(eeepc, CM_ASL_WLAN); 927 wlan = get_acpi(eeepc, CM_ASL_WLAN);
928 set_acpi(eeepc, CM_ASL_WLAN, wlan); 928 if (wlan >= 0)
929 set_acpi(eeepc, CM_ASL_WLAN, wlan);
929 } 930 }
930 931
931 return 0; 932 return 0;