]> git.proxmox.com Git - mirror_ubuntu-bionic-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)
committerStefan Bader <stefan.bader@canonical.com>
Tue, 14 Aug 2018 10:25:21 +0000 (12:25 +0200)
commitaeaab388529b8d3728754c30a42ff4093bc61097
tree7c686888740f04e053af3b448394817549519f05
parent28a207f013e9528d6b7e6e15c1093d414d188da3
usb: musb: host: fix potential NULL pointer dereference

BugLink: http://bugs.launchpad.net/bugs/1778759
commit 2b63f1329df2cd814c1f8353fae4853ace6521d1 upstream.

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: f283862f3b5c ("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>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
drivers/usb/musb/musb_host.c