From: Nicolas Iooss <nicolas.iooss_linux@m4x.org>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Hans de Goede <hdegoede@redhat.com>,
devel@driverdev.osuosl.org
Cc: linux-kernel@vger.kernel.org,
Nicolas Iooss <nicolas.iooss_linux@m4x.org>
Subject: [PATCH 1/1] staging: rtl8723bs: make memcmp() calls consistent
Date: Sun, 10 Dec 2017 20:35:12 +0100 [thread overview]
Message-ID: <20171210193512.6309-1-nicolas.iooss_linux@m4x.org> (raw)
rtw_pm_set() uses memcmp() with 5-chars strings and a length of 4 when
parsing extra, and then parses extra+4 as an int:
if (!memcmp(extra, "lps =", 4)) {
sscanf(extra+4, "%u", &mode);
/* ... */
} else if (!memcmp(extra, "ips =", 4)) {
sscanf(extra+4, "%u", &mode);
The space between the key ("lps" and "ips") and the equal sign seems
suspicious. Remove it in order to make the calls to memcmp() consistent.
Signed-off-by: Nicolas Iooss <nicolas.iooss_linux@m4x.org>
---
drivers/staging/rtl8723bs/os_dep/ioctl_linux.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/staging/rtl8723bs/os_dep/ioctl_linux.c b/drivers/staging/rtl8723bs/os_dep/ioctl_linux.c
index 3fca0c2d4c8d..ffcfefefc898 100644
--- a/drivers/staging/rtl8723bs/os_dep/ioctl_linux.c
+++ b/drivers/staging/rtl8723bs/os_dep/ioctl_linux.c
@@ -4561,10 +4561,10 @@ static int rtw_pm_set(struct net_device *dev,
DBG_871X("[%s] extra = %s\n", __func__, extra);
- if (!memcmp(extra, "lps =", 4)) {
+ if (!memcmp(extra, "lps=", 4)) {
sscanf(extra+4, "%u", &mode);
ret = rtw_pm_set_lps(padapter, mode);
- } else if (!memcmp(extra, "ips =", 4)) {
+ } else if (!memcmp(extra, "ips=", 4)) {
sscanf(extra+4, "%u", &mode);
ret = rtw_pm_set_ips(padapter, mode);
} else {
--
2.15.0
next reply other threads:[~2017-12-10 19:35 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-12-10 19:35 Nicolas Iooss [this message]
2017-12-13 11:47 ` Greg Kroah-Hartman
2017-12-13 14:49 ` Hans de Goede
2017-12-13 15:12 ` Rasmus Villemoes
2017-12-13 16:00 ` Hans de Goede
2017-12-13 16:10 ` Greg Kroah-Hartman
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=20171210193512.6309-1-nicolas.iooss_linux@m4x.org \
--to=nicolas.iooss_linux@m4x.org \
--cc=devel@driverdev.osuosl.org \
--cc=gregkh@linuxfoundation.org \
--cc=hdegoede@redhat.com \
--cc=linux-kernel@vger.kernel.org \
/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®