]> git.baikalelectronics.ru Git - kernel.git/commit
usbnet: ignore endpoints with invalid wMaxPacketSize
authorBjørn Mork <bjorn@mork.no>
Wed, 18 Sep 2019 12:17:38 +0000 (14:17 +0200)
committerJakub Kicinski <jakub.kicinski@netronome.com>
Sat, 21 Sep 2019 19:06:55 +0000 (12:06 -0700)
commitdefd8a7176bbd54e02728507a4f2dbe9a258be32
tree960260760a86a6189cf73fc2c9bee21a44af7e0a
parent0bbface22322b6d2b2f8924219d118038c316412
usbnet: ignore endpoints with invalid wMaxPacketSize

Endpoints with zero wMaxPacketSize are not usable for transferring
data. Ignore such endpoints when looking for valid in, out and
status pipes, to make the drivers more robust against invalid and
meaningless descriptors.

The wMaxPacketSize of these endpoints are used for memory allocations
and as divisors in many usbnet minidrivers. Avoiding zero is therefore
critical.

Signed-off-by: Bjørn Mork <bjorn@mork.no>
Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
drivers/net/usb/usbnet.c