Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a60f2f2f authored by Felipe Balbi's avatar Felipe Balbi Committed by Greg Kroah-Hartman
Browse files

usb: host: xhci: unconditionally call xhci_unmap_td_bounce_buffer()



xhci_unmap_td_bounce_buffer() already checks for a valid td->bounce_seg
and bails out early if that's invalid. There's no need to check for this
twice.

Signed-off-by: default avatarFelipe Balbi <felipe.balbi@linux.intel.com>
Signed-off-by: default avatarMathias Nyman <mathias.nyman@linux.intel.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent f45e2a02
Loading
Loading
Loading
Loading
+3 −6
Original line number Diff line number Diff line
@@ -793,7 +793,6 @@ static void xhci_handle_cmd_stop_ep(struct xhci_hcd *xhci, int slot_id,
		 * just overwrite it (because the URB has been unlinked).
		 */
		ep_ring = xhci_urb_to_transfer_ring(xhci, cur_td->urb);
		if (ep_ring && cur_td->bounce_seg)
		xhci_unmap_td_bounce_buffer(xhci, ep_ring, cur_td);
		inc_td_cnt(cur_td->urb);
		if (last_td_in_urb(cur_td))
@@ -820,7 +819,6 @@ static void xhci_kill_ring_urbs(struct xhci_hcd *xhci, struct xhci_ring *ring)
		if (!list_empty(&cur_td->cancelled_td_list))
			list_del_init(&cur_td->cancelled_td_list);

		if (cur_td->bounce_seg)
		xhci_unmap_td_bounce_buffer(xhci, ring, cur_td);

		inc_td_cnt(cur_td->urb);
@@ -1833,7 +1831,6 @@ static int xhci_td_cleanup(struct xhci_hcd *xhci, struct xhci_td *td,
	urb_priv = urb->hcpriv;

	/* if a bounce buffer was used to align this td then unmap it */
	if (td->bounce_seg)
	xhci_unmap_td_bounce_buffer(xhci, ep_ring, td);

	/* Do one last check of the actual transfer length.