r8152: add missing endpoint sanity check
authorJohan Hovold <johan@kernel.org>
Tue, 14 Jan 2020 08:27:29 +0000 (09:27 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 23 Jan 2020 07:22:51 +0000 (08:22 +0100)
commitfdca076a9a91f4f352c12ab118a98c2b2da30577
treec59e1f6be18f7ae9fd5e6223ad5695f43a889765
parent4fd16cfcc3ae28cf42c67941fd529600f21bec39
r8152: add missing endpoint sanity check

[ Upstream commit 86f3f4cd53707ceeec079b83205c8d3c756eca93 ]

Add missing endpoint sanity check to probe in order to prevent a
NULL-pointer dereference (or slab out-of-bounds access) when retrieving
the interrupt-endpoint bInterval on ndo_open() in case a device lacks
the expected endpoints.

Fixes: 40a82917b1d3 ("net/usb/r8152: enable interrupt transfer")
Cc: hayeswang <hayeswang@realtek.com>
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/r8152.c