]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - releases/4.9.30/usb-chaoskey-fix-alea-quirk-on-big-endian-hosts.patch
Linux 4.14.95
[thirdparty/kernel/stable-queue.git] / releases / 4.9.30 / usb-chaoskey-fix-alea-quirk-on-big-endian-hosts.patch
1 From 63afd5cc78775018ea2dec4004428dafa5283e93 Mon Sep 17 00:00:00 2001
2 From: Johan Hovold <johan@kernel.org>
3 Date: Thu, 11 May 2017 11:36:01 +0200
4 Subject: USB: chaoskey: fix Alea quirk on big-endian hosts
5
6 From: Johan Hovold <johan@kernel.org>
7
8 commit 63afd5cc78775018ea2dec4004428dafa5283e93 upstream.
9
10 Add missing endianness conversion when applying the Alea timeout quirk.
11
12 Found using sparse:
13
14 warning: restricted __le16 degrades to integer
15
16 Fixes: e4a886e811cd ("hwrng: chaoskey - Fix URB warning due to timeout on Alea")
17 Cc: Bob Ham <bob.ham@collabora.com>
18 Cc: Herbert Xu <herbert@gondor.apana.org.au>
19 Cc: Keith Packard <keithp@keithp.com>
20 Signed-off-by: Johan Hovold <johan@kernel.org>
21 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
22
23 ---
24 drivers/usb/misc/chaoskey.c | 2 +-
25 1 file changed, 1 insertion(+), 1 deletion(-)
26
27 --- a/drivers/usb/misc/chaoskey.c
28 +++ b/drivers/usb/misc/chaoskey.c
29 @@ -194,7 +194,7 @@ static int chaoskey_probe(struct usb_int
30
31 dev->in_ep = in_ep;
32
33 - if (udev->descriptor.idVendor != ALEA_VENDOR_ID)
34 + if (le16_to_cpu(udev->descriptor.idVendor) != ALEA_VENDOR_ID)
35 dev->reads_started = 1;
36
37 dev->size = size;