Commit 2b63f132 authored by Bin Liu's avatar Bin Liu Committed by Greg Kroah-Hartman

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: f283862f ("usb: musb: NAK timeout scheme on bulk TX endpoint")
Cc: stable@vger.kernel.org # v3.7+
Signed-off-by: default avatarBin Liu <b-liu@ti.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 328da899
...@@ -990,6 +990,8 @@ static void musb_bulk_nak_timeout(struct musb *musb, struct musb_hw_ep *ep, ...@@ -990,6 +990,8 @@ static void musb_bulk_nak_timeout(struct musb *musb, struct musb_hw_ep *ep,
/* set tx_reinit and schedule the next qh */ /* set tx_reinit and schedule the next qh */
ep->tx_reinit = 1; ep->tx_reinit = 1;
} }
if (next_qh)
musb_start_urb(musb, is_in, next_qh); musb_start_urb(musb, is_in, next_qh);
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment