From: Ayman Bagabas <ayman.bagabas@gmail.com>
To: Darren Hart <dvhart@infradead.org>,
Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
Ayman Bagabas <ayman.bagabas@gmail.com>,
Takashi Iwai <tiwai@suse.de>, Mattias Jacobsson <2pi@mok.nu>,
kbuild test robot <lkp@intel.com>,
Dan Carpenter <dan.carpenter@oracle.com>,
platform-driver-x86@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: [PATCH 1/3] platform/x86: huawei-wmi: Stricter battery thresholds set
Date: Sun, 20 Oct 2019 13:00:07 -0400 [thread overview]
Message-ID: <20191020170020.26251-1-ayman.bagabas@gmail.com> (raw)
Check if battery thresholds are within 0 and 100.
Fixes: 355a070b09ab ("platform/x86: huawei-wmi: Add battery charging thresholds")
Signed-off-by: Ayman Bagabas <ayman.bagabas@gmail.com>
---
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: c4b9850b3676869ac0def5885d781d17f64b3a86
--
2.21.0
next reply other threads:[~2019-10-20 17:00 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-10-20 17:00 Ayman Bagabas [this message]
2019-10-20 17:00 ` [PATCH 2/3] platform/x86: huawei-wmi: No need to check for battery name Ayman Bagabas
2019-10-20 17:00 ` [PATCH 3/3] platform/x86: huawei-wmi: Remove unnecessary battery mutex Ayman Bagabas
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20191020170020.26251-1-ayman.bagabas@gmail.com \
--to=ayman.bagabas@gmail.com \
--cc=2pi@mok.nu \
--cc=andriy.shevchenko@linux.intel.com \
--cc=dan.carpenter@oracle.com \
--cc=dvhart@infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lkp@intel.com \
--cc=platform-driver-x86@vger.kernel.org \
--cc=tiwai@suse.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®