From: karthik alapati <mail@karthek.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Lee Jones <lee.jones@linaro.org>,
Johannes Berg <johannes@sipsolutions.net>,
Arnd Bergmann <arnd@arndb.de>
Cc: devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org
Subject: [PATCH] staging: i2400m: use explicit host byte-order types in comparison
Date: Fri, 19 Feb 2021 06:00:47 +0530 [thread overview]
Message-ID: <YC8Gt4sawUiuTTE3@karthik-strix-linux.karthek.com> (raw)
convert le32 types to host byte-order types before
comparison
Signed-off-by: karthik alapati <mail@karthek.com>
---
i wonder how these could be false-positives
drivers/staging/wimax/i2400m/fw.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/staging/wimax/i2400m/fw.c b/drivers/staging/wimax/i2400m/fw.c
index edb5eba0898b..13207c985a87 100644
--- a/drivers/staging/wimax/i2400m/fw.c
+++ b/drivers/staging/wimax/i2400m/fw.c
@@ -191,7 +191,7 @@ void i2400m_bm_cmd_prepare(struct i2400m_bootrom_header *cmd)
int i;
u32 checksum = 0;
const u32 *checksum_ptr = (void *) cmd->payload;
- for (i = 0; i < cmd->data_size / 4; i++)
+ for (i = 0; i < le32_to_cpu(cmd->data_size) / 4; i++)
checksum += cpu_to_le32(*checksum_ptr++);
checksum += cmd->command + cmd->target_addr + cmd->data_size;
cmd->block_checksum = cpu_to_le32(checksum);
@@ -506,7 +506,7 @@ ssize_t __i2400m_bm_ack_verify(struct i2400m *i2400m, int opcode,
opcode, i2400m_brh_get_response(ack));
goto error_ack_failed;
}
- if (ack_size < ack->data_size + sizeof(*ack)) {
+ if (ack_size < le32_to_cpu(ack->data_size) + sizeof(*ack)) {
dev_err(dev, "boot-mode cmd %d: SW BUG "
"driver provided only %zu bytes for %zu bytes "
"of data\n", opcode, ack_size,
--
2.30.1
next reply other threads:[~2021-02-19 0:31 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-02-19 0:30 karthik alapati [this message]
2021-02-19 6:21 ` 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=YC8Gt4sawUiuTTE3@karthik-strix-linux.karthek.com \
--to=mail@karthek.com \
--cc=arnd@arndb.de \
--cc=devel@driverdev.osuosl.org \
--cc=gregkh@linuxfoundation.org \
--cc=johannes@sipsolutions.net \
--cc=lee.jones@linaro.org \
--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®