From 1d87a05cbbacc301a84d75368d8c7e2b469d47fa Mon Sep 17 00:00:00 2001 From: Kautuk Consul Date: Mon, 19 Sep 2011 16:53:12 -0700 Subject: [PATCH] --- yaml --- r: 265010 b: refs/heads/master c: 0e6c7f746ea99089fb3263709075c20485a479ae h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/drivers/usb/host/xhci-mem.c | 22 ++++++++++++---------- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/[refs] b/[refs] index 9075f0096bc5..a1c9c9711419 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 10d674a82e553cb8a1f41027bb3c3e309b3f6804 +refs/heads/master: 0e6c7f746ea99089fb3263709075c20485a479ae diff --git a/trunk/drivers/usb/host/xhci-mem.c b/trunk/drivers/usb/host/xhci-mem.c index 94a8b28d602e..e4513ab015b4 100644 --- a/trunk/drivers/usb/host/xhci-mem.c +++ b/trunk/drivers/usb/host/xhci-mem.c @@ -112,18 +112,20 @@ void xhci_ring_free(struct xhci_hcd *xhci, struct xhci_ring *ring) struct xhci_segment *seg; struct xhci_segment *first_seg; - if (!ring || !ring->first_seg) + if (!ring) return; - first_seg = ring->first_seg; - seg = first_seg->next; - xhci_dbg(xhci, "Freeing ring at %p\n", ring); - while (seg != first_seg) { - struct xhci_segment *next = seg->next; - xhci_segment_free(xhci, seg); - seg = next; + if (ring->first_seg) { + first_seg = ring->first_seg; + seg = first_seg->next; + xhci_dbg(xhci, "Freeing ring at %p\n", ring); + while (seg != first_seg) { + struct xhci_segment *next = seg->next; + xhci_segment_free(xhci, seg); + seg = next; + } + xhci_segment_free(xhci, first_seg); + ring->first_seg = NULL; } - xhci_segment_free(xhci, first_seg); - ring->first_seg = NULL; kfree(ring); }