]> git.itanic.dy.fi Git - linux-stable/commit
r8152: add missing endpoint sanity check
authorJohan Hovold <johan@kernel.org>
Tue, 14 Jan 2020 08:27:29 +0000 (09:27 +0100)
committerBen Hutchings <ben@decadent.org.uk>
Tue, 28 Apr 2020 18:03:26 +0000 (19:03 +0100)
commita95d9e284c593ab213829bd15df59bb9731fe226
tree655db64638198e8d1d1b99295156d11ab8455b22
parent92f13288053b69ea84cb2ed3f5bd6bfaba8a879d
r8152: add missing endpoint sanity check

commit 86f3f4cd53707ceeec079b83205c8d3c756eca93 upstream.

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: Ben Hutchings <ben@decadent.org.uk>
drivers/net/usb/r8152.c