diff options
author | Jérôme Pouiller <jerome.pouiller@silabs.com> | 2020-05-12 17:04:07 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2020-05-13 13:49:44 +0200 |
commit | b8743c786bbd6b9ac63c98401b60b9a3400049de (patch) | |
tree | 0b6488f629f4065201994c008d7682dfd6a17e68 /drivers/staging/wfx/hif_rx.c | |
parent | 1bca434cc273a0c04e23746914b1717812c7d1d1 (diff) |
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: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20200512150414.267198-11-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/wfx/hif_rx.c')
-rw-r--r-- | drivers/staging/wfx/hif_rx.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/staging/wfx/hif_rx.c b/drivers/staging/wfx/hif_rx.c index 966315edbab8..fca9df620ad9 100644 --- a/drivers/staging/wfx/hif_rx.c +++ b/drivers/staging/wfx/hif_rx.c @@ -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; } } |