aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/wfx
diff options
context:
space:
mode:
authorJérôme Pouiller <jerome.pouiller@silabs.com>2019-10-08 09:42:59 +0000
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-10-08 14:41:14 +0200
commit6d68ac8b5b5c27013a8223766cd8d397229c7802 (patch)
tree0c144c40d182255ec25e7bf25b84c2c64daf06db /drivers/staging/wfx
parentstaging: wfx: remove misused call to cpu_to_le16() (diff)
downloadlinux-dev-6d68ac8b5b5c27013a8223766cd8d397229c7802.tar.xz
linux-dev-6d68ac8b5b5c27013a8223766cd8d397229c7802.zip
staging: wfx: le16_to_cpus() takes a reference as parameter
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@intel.com> Reported-by: Stephen Rothwell <sfr@canb.auug.org.au> Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com> Link: https://lore.kernel.org/r/20191008094232.10014-4-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/wfx')
-rw-r--r--drivers/staging/wfx/bh.c4
1 files 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) {