]> git.baikalelectronics.ru Git - kernel.git/commit
xhci: Fix potential NULL ptr deref in command cancellation.
authorSarah Sharp <sarah.a.sharp@linux.intel.com>
Tue, 16 Oct 2012 20:17:43 +0000 (13:17 -0700)
committerSarah Sharp <sarah.a.sharp@linux.intel.com>
Thu, 25 Oct 2012 20:13:47 +0000 (13:13 -0700)
commitce76e3456d236b644bdb031b90abf5a293809363
tree93ea7c67e4bff6051cc652878b71fe75fd21825d
parent390d89fc674972740de5d652bf3aea48eaeeaf94
xhci: Fix potential NULL ptr deref in command cancellation.

The command cancellation code doesn't check whether find_trb_seg()
couldn't find the segment that contains the TRB to be canceled.  This
could cause a NULL pointer deference later in the function when next_trb
is called.  It's unlikely to happen unless something is wrong with the
command ring pointers, so add some debugging in case it happens.

This patch should be backported to stable kernels as old as 3.0, that
contain the commit 6cdb1c598e4347ebd6465aace627732765fe7aaa "xHCI:
handle command after aborting the command ring".

Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
Cc: stable@vger.kernel.org
drivers/usb/host/xhci-ring.c