xhci: fix null pointer dereference on ring_doorbell_for_active_rings
authorOleksij Rempel <linux@rempel-privat.de>
Sun, 21 Jul 2013 13:36:19 +0000 (15:36 +0200)
committerBen Hutchings <ben@decadent.org.uk>
Fri, 2 Aug 2013 20:15:09 +0000 (22:15 +0200)
commit68a127fb3d6c045ae4e464e6e1c79c568c2aa031
tree85025ce94b24741092bbc6608e37ab7f60d97aa7
parent5829ddf034667a3e8ce3e853cae6139f66244313
xhci: fix null pointer dereference on ring_doorbell_for_active_rings

commit d66eaf9f89502971fddcb0de550b01fa6f409d83 upstream.

in some cases where device is attched to xhci port and do not responding,
for example ath9k_htc with stalled firmware, kernel will
crash on ring_doorbell_for_active_rings.
This patch check if pointer exist before it is used.

This patch should be backported to kernels as old as 2.6.35, that
contain the commit e9df17eb1408cfafa3d1844bfc7f22c7237b31b8 "USB: xhci:
Correct assumptions about number of rings per endpoint"

Signed-off-by: Oleksij Rempel <linux@rempel-privat.de>
Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
drivers/usb/host/xhci-ring.c