All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] platform/x86: huawei-wmi: Stricter battery thresholds set
@ 2019-10-18 22:42 Ayman Bagabas
  2019-10-18 22:42 ` [PATCH 2/2] platform/x86: huawei-wmi: No need to check for battery name Ayman Bagabas
  2019-10-19  8:31 ` [PATCH 1/2] platform/x86: huawei-wmi: Stricter battery thresholds set Dan Carpenter
  0 siblings, 2 replies; 6+ messages in thread
From: Ayman Bagabas @ 2019-10-18 22:42 UTC (permalink / raw)
  To: Darren Hart, Andy Shevchenko, Ayman Bagabas, Mattias Jacobsson,
	Takashi Iwai, Dan Carpenter, kbuild test robot,
	platform-driver-x86, linux-kernel

Check if battery thresholds are within 0 and 100.
---
 drivers/platform/x86/huawei-wmi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/platform/x86/huawei-wmi.c b/drivers/platform/x86/huawei-wmi.c
index 5837d1b8693d..26041d44286a 100644
--- a/drivers/platform/x86/huawei-wmi.c
+++ b/drivers/platform/x86/huawei-wmi.c
@@ -345,7 +345,7 @@ static int huawei_wmi_battery_set(int start, int end)
 	union hwmi_arg arg;
 	int err;
 
-	if (start < 0 || end > 100)
+	if (start < 0 || end < 0 || start > 100 || end > 100)
 		return -EINVAL;
 
 	arg.cmd = BATTERY_THRESH_SET;

base-commit: fd13c8622a5ad4f7317b64de4f6aa2de1962220e
-- 
2.21.0


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2019-10-20  7:56 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-18 22:42 [PATCH 1/2] platform/x86: huawei-wmi: Stricter battery thresholds set Ayman Bagabas
2019-10-18 22:42 ` [PATCH 2/2] platform/x86: huawei-wmi: No need to check for battery name Ayman Bagabas
2019-10-20  0:33   ` ayman.bagabas
2019-10-19  8:31 ` [PATCH 1/2] platform/x86: huawei-wmi: Stricter battery thresholds set Dan Carpenter
2019-10-20  0:32   ` ayman.bagabas
2019-10-20  7:55     ` Andy Shevchenko

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.