Skip to content

Commit 303e99b

Browse files
liubiingregkh
authored andcommitted
usb: musb: host: fix potential NULL pointer dereference
commit 2b63f13 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: f283862 ("usb: musb: NAK timeout scheme on bulk TX endpoint") Cc: [email protected] # v3.7+ Signed-off-by: Bin Liu <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent ec6de93 commit 303e99b

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

drivers/usb/musb/musb_host.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1023,7 +1023,9 @@ static void musb_bulk_nak_timeout(struct musb *musb, struct musb_hw_ep *ep,
10231023
/* set tx_reinit and schedule the next qh */
10241024
ep->tx_reinit = 1;
10251025
}
1026-
musb_start_urb(musb, is_in, next_qh);
1026+
1027+
if (next_qh)
1028+
musb_start_urb(musb, is_in, next_qh);
10271029
}
10281030
}
10291031

0 commit comments

Comments
 (0)