]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
net: lan78xx: replace bogus endpoint lookup
authorJohan Hovold <johan@kernel.org>
Tue, 28 Jul 2020 12:10:31 +0000 (14:10 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 21 Aug 2020 08:52:57 +0000 (10:52 +0200)
commitb3953988b0dde9e804d9e8247a93cda86ed161de
tree98bd1c1f1e74b2f2d28f07f041093d8453269084
parentb2568460fcdd48444119fac6b033ede1668614b5
net: lan78xx: replace bogus endpoint lookup

[ Upstream commit ea060b352654a8de1e070140d25fe1b7e4d50310 ]

Drop the bogus endpoint-lookup helper which could end up accepting
interfaces based on endpoints belonging to unrelated altsettings.

Note that the returned bulk pipes and interrupt endpoint descriptor
were never actually used. Instead the bulk-endpoint numbers are
hardcoded to 1 and 2 (matching the specification), while the interrupt-
endpoint descriptor was assumed to be the third descriptor created by
USB core.

Try to bring some order to this by dropping the bogus lookup helper and
adding the missing endpoint sanity checks while keeping the interrupt-
descriptor assumption for now.

Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/usb/lan78xx.c