[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20191008094232.10014-4-Jerome.Pouiller@silabs.com>
Date: Tue, 8 Oct 2019 09:42:59 +0000
From: Jerome Pouiller <Jerome.Pouiller@...abs.com>
To: "devel@...verdev.osuosl.org" <devel@...verdev.osuosl.org>
CC: "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Jerome Pouiller <Jerome.Pouiller@...abs.com>,
kbuild test robot <lkp@...el.com>,
Stephen Rothwell <sfr@...b.auug.org.au>
Subject: [PATCH 3/7] staging: wfx: le16_to_cpus() takes a reference as
parameter
From: Jérôme Pouiller <jerome.pouiller@...abs.com>
Original code caused an (100% reproducible) invalid memory access on
big-endian targets.
Fixes: b0998f0c040d "staging: wfx: add IRQ handling"
Reported-by: kbuild test robot <lkp@...el.com>
Reported-by: Stephen Rothwell <sfr@...b.auug.org.au>
Signed-off-by: Jérôme Pouiller <jerome.pouiller@...abs.com>
---
drivers/staging/wfx/bh.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/staging/wfx/bh.c b/drivers/staging/wfx/bh.c
index 6000c03bb658..3715bb18bd78 100644
--- a/drivers/staging/wfx/bh.c
+++ b/drivers/staging/wfx/bh.c
@@ -83,12 +83,12 @@ static int rx_helper(struct wfx_dev *wdev, size_t read_len, int *is_cnf)
// piggyback is probably correct.
return piggyback;
}
- le16_to_cpus(hif->len);
+ le16_to_cpus(&hif->len);
computed_len = round_up(hif->len - sizeof(hif->len), 16)
+ sizeof(struct hif_sl_msg)
+ sizeof(struct hif_sl_tag);
} else {
- le16_to_cpus(hif->len);
+ le16_to_cpus(&hif->len);
computed_len = round_up(hif->len, 2);
}
if (computed_len != read_len) {
--
2.20.1
Powered by blists - more mailing lists