xhci: fix list access before init
authorVladimir Murzin <murzin.v@gmail.com>
Tue, 9 Apr 2013 18:33:31 +0000 (22:33 +0400)
committerBen Hutchings <ben@decadent.org.uk>
Wed, 19 Jun 2013 01:16:48 +0000 (02:16 +0100)
commitecc05abda92e00b32c88707b38c85182cf4b2725
tree7bbdc9a7543455b1be465d079c5960a494d36470
parenta1580a95fd066e3cbe9057ad2b87bfd5ace521bf
xhci: fix list access before init

commit 88696ae432ce7321540ac53d9caab3de9118b094 upstream.

If for whatever reason we fall into fail path in xhci_mem_init()
before bw table gets initialized we may access the uninitialized lists
in xhci_mem_cleanup().

Check for bw table before traversing lists in cleanup routine.

This patch should be backported to kernels as old as 3.2, that contain
the commit 839c817ce67178ca3c7c7ad534c571bba1e69ebe "xhci: Store
information about roothubs and TTs."

Reported-by: Sergey Dyasly <dserrg@gmail.com>
Tested-by: Sergey Dyasly <dserrg@gmail.com>
Signed-off-by: Vladimir Murzin <murzin.v@gmail.com>
Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
drivers/usb/host/xhci-mem.c