staging: wfx: le16_to_cpus() takes a reference as parameter

Original code caused an (100% reproducible) invalid memory access on
big-endian targets.

Fixes: b0998f0c04 "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>
This commit is contained in:
Jérôme Pouiller 2019-10-08 09:42:59 +00:00 коммит произвёл Greg Kroah-Hartman
Родитель 488d349061
Коммит 6d68ac8b5b
1 изменённых файлов: 2 добавлений и 2 удалений

Просмотреть файл

@ -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) {