diff mbox series

[1/2] platform/x86: huawei-wmi: Stricter battery thresholds set

Message ID 20191018224221.15495-1-ayman.bagabas@gmail.com (mailing list archive)
State Changes Requested, archived
Headers show
Series [1/2] platform/x86: huawei-wmi: Stricter battery thresholds set | expand

Commit Message

Ayman Bagabas Oct. 18, 2019, 10:42 p.m. UTC
Check if battery thresholds are within 0 and 100.
---
 drivers/platform/x86/huawei-wmi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)


base-commit: fd13c8622a5ad4f7317b64de4f6aa2de1962220e

Comments

Dan Carpenter Oct. 19, 2019, 8:31 a.m. UTC | #1
On Fri, Oct 18, 2019 at 06:42:13PM -0400, Ayman Bagabas wrote:
> Check if battery thresholds are within 0 and 100.
> ---

Thanks!

Don't forget to add your Signed-off-by: though.

regards,
dan carpenter
Ayman Bagabas Oct. 20, 2019, 12:32 a.m. UTC | #2
On Sat, 2019-10-19 at 11:31 +0300, Dan Carpenter wrote:
> On Fri, Oct 18, 2019 at 06:42:13PM -0400, Ayman Bagabas wrote:
> > Check if battery thresholds are within 0 and 100.
> > ---
> 
> Thanks!
> 
> Don't forget to add your Signed-off-by: though.

Signed-off-by: Ayman Bagabas <ayman.bagabas@gmail.com>

Thank you,
Ayman
> 
> regards,
> dan carpenter
>
Andy Shevchenko Oct. 20, 2019, 7:55 a.m. UTC | #3
On Sun, Oct 20, 2019 at 3:33 AM <ayman.bagabas@gmail.com> wrote:
> On Sat, 2019-10-19 at 11:31 +0300, Dan Carpenter wrote:
> > On Fri, Oct 18, 2019 at 06:42:13PM -0400, Ayman Bagabas wrote:
> > > Check if battery thresholds are within 0 and 100.

> > Don't forget to add your Signed-off-by: though.

Please, resend all three with properly tagged with Sob, Fixes, etc.
diff mbox series

Patch

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;