]> git.karo-electronics.de Git - karo-tx-linux.git/commit
xhci-mem.c: Check for ring->first_seg != NULL
authorKautuk Consul <consul.kautuk@gmail.com>
Mon, 19 Sep 2011 23:53:12 +0000 (16:53 -0700)
committerPaul Gortmaker <paul.gortmaker@windriver.com>
Fri, 17 Aug 2012 19:35:25 +0000 (15:35 -0400)
commit95e8d5a47d4b06822dbdb6eef332b4e3e05d2a12
treec4886c672151b7c382721b2a4135d4fc9f009732
parent077e5f18f415645c7f180738f73a123bef9876e4
xhci-mem.c: Check for ring->first_seg != NULL

commit 0e6c7f746ea99089fb3263709075c20485a479ae upstream.

There are 2 situations wherein the xhci_ring* might not get freed:
- When xhci_ring_alloc() -> xhci_segment_alloc() returns NULL and
  we goto the fail: label in xhci_ring_alloc. In this case, the ring
  will not get kfreed.
- When the num_segs argument to xhci_ring_alloc is passed as 0 and
  we try to free the rung after that.
  ( This doesn't really happen as of now in the code but we seem to
    be entertaining num_segs=0 in xhci_ring_alloc )

This should be backported to kernels as old as 2.6.31.

Signed-off-by: Kautuk Consul <consul.kautuk@gmail.com>
Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
drivers/usb/host/xhci-mem.c