]> git.baikalelectronics.ru Git - kernel.git/commit
net: cdc_ncm: GetNtbFormat endian fix
authorBjørn Mork <bjorn@mork.no>
Wed, 15 Nov 2017 08:35:02 +0000 (09:35 +0100)
committerDavid S. Miller <davem@davemloft.net>
Wed, 15 Nov 2017 10:43:54 +0000 (19:43 +0900)
commit596e9250faa086ae105ad59f52ee8c2f4829a6b2
tree0df41369825588fd52ceb906f44cdc64fca90190
parent9da0404107ee41f6231415dff2171499ba85a2f6
net: cdc_ncm: GetNtbFormat endian fix

The GetNtbFormat and SetNtbFormat requests operate on 16 bit little
endian values. We get away with ignoring this most of the time, because
we only care about USB_CDC_NCM_NTB16_FORMAT which is 0x0000.  This
fails for USB_CDC_NCM_NTB32_FORMAT.

Fix comparison between LE value from device and constant by converting
the constant to LE.

Reported-by: Ben Hutchings <ben.hutchings@codethink.co.uk>
Fixes: 3cc9628cbbb9 ("cdc_ncm: Set NTB format again after altsetting switch for Huawei devices")
Cc: Enrico Mioso <mrkiko.rs@gmail.com>
Cc: Christian Panton <christian@panton.org>
Signed-off-by: Bjørn Mork <bjorn@mork.no>
Acked-By: Enrico Mioso <mrkiko.rs@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/usb/cdc_ncm.c