Commit b8743c78 authored by Jérôme Pouiller's avatar Jérôme Pouiller Committed by Greg Kroah-Hartman

staging: wfx: fix access to le32 attribute 'indication_type'

The attribute indication_type is little-endian. We have to take to the
endianness when we access it.
Signed-off-by: default avatarJérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20200512150414.267198-11-Jerome.Pouiller@silabs.comSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 1bca434c
......@@ -259,8 +259,9 @@ static int hif_generic_indication(struct wfx_dev *wdev,
const struct hif_msg *hif, const void *buf)
{
const struct hif_ind_generic *body = buf;
int type = le32_to_cpu(body->indication_type);
switch (body->indication_type) {
switch (type) {
case HIF_GENERIC_INDICATION_TYPE_RAW:
return 0;
case HIF_GENERIC_INDICATION_TYPE_STRING:
......@@ -278,9 +279,8 @@ static int hif_generic_indication(struct wfx_dev *wdev,
mutex_unlock(&wdev->rx_stats_lock);
return 0;
default:
dev_err(wdev->dev,
"generic_indication: unknown indication type: %#.8x\n",
body->indication_type);
dev_err(wdev->dev, "generic_indication: unknown indication type: %#.8x\n",
type);
return -EIO;
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment