From: Felipe Balbi Date: Mon, 23 Jan 2017 12:20:13 +0000 (+0200) Subject: usb: host: xhci: check for a valid ring when unmapping bounce buffer X-Git-Tag: v4.11-rc1~119^2~57 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=f45e2a02112a1ed03925521c9f48e4bdc25c7032;p=karo-tx-linux.git usb: host: xhci: check for a valid ring when unmapping bounce buffer This way we can remove checks for valid ring from call sites of xhci_unmap_td_bounce_buffer() Signed-off-by: Felipe Balbi Signed-off-by: Mathias Nyman Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c index 9084afb97a58..0de9966451f9 100644 --- a/drivers/usb/host/xhci-ring.c +++ b/drivers/usb/host/xhci-ring.c @@ -655,7 +655,7 @@ static void xhci_unmap_td_bounce_buffer(struct xhci_hcd *xhci, struct xhci_segment *seg = td->bounce_seg; struct urb *urb = td->urb; - if (!seg || !urb) + if (!ring || !seg || !urb) return; if (usb_urb_dir_out(urb)) {