mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-08 17:49:45 +00:00
usb: musb: host: fix potential NULL pointer dereference
commit2b63f1329d
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:f283862f3b
("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>
This commit is contained in:
parent
ec6de93fab
commit
303e99bde8
1 changed files with 3 additions and 1 deletions
|
@ -1023,7 +1023,9 @@ static void musb_bulk_nak_timeout(struct musb *musb, struct musb_hw_ep *ep,
|
|||
/* set tx_reinit and schedule the next qh */
|
||||
ep->tx_reinit = 1;
|
||||
}
|
||||
musb_start_urb(musb, is_in, next_qh);
|
||||
|
||||
if (next_qh)
|
||||
musb_start_urb(musb, is_in, next_qh);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue