]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/commitdiff
usb: host: xhci: check for a valid ring when unmapping bounce buffer
authorFelipe Balbi <felipe.balbi@linux.intel.com>
Mon, 23 Jan 2017 12:20:13 +0000 (14:20 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 25 Jan 2017 09:59:06 +0000 (10:59 +0100)
This way we can remove checks for valid ring from call sites of
xhci_unmap_td_bounce_buffer()

Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/host/xhci-ring.c

index 9084afb97a58c352458f4075a25d331e87a5400b..0de9966451f92b83cecf231aeb8ff993e1c67fd5 100644 (file)
@@ -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)) {