]> git.baikalelectronics.ru Git - kernel.git/commit
usb: musb: host: fix potential NULL pointer dereference
authorBin Liu <b-liu@ti.com>
Mon, 30 Apr 2018 16:20:53 +0000 (11:20 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 30 Apr 2018 16:52:17 +0000 (09:52 -0700)
commit2fac87978fb2826376814a909661e42639579dd2
treecb73bffd02e7d55c7c8bb1e6a086a5fe301363c9
parent0fe38fb89d9a05a89ef11d08881e54ef63576874
usb: musb: host: fix potential NULL pointer dereference

musb_start_urb() doesn't check the pass-in parameter if it is NULL.  But
in musb_bulk_nak_timeout() the parameter passed to musb_start_urb() is
returned from first_qh(), which could be NULL.

So wrap the musb_start_urb() call here with a if condition check to
avoid the potential NULL pointer dereference.

Fixes: 14b2c690f213 ("usb: musb: NAK timeout scheme on bulk TX endpoint")
Cc: stable@vger.kernel.org # v3.7+
Signed-off-by: Bin Liu <b-liu@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/musb/musb_host.c