]> www.infradead.org Git - users/jedix/linux-maple.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)
committerGuangyu Sun <guangyu.sun@oracle.com>
Tue, 6 Nov 2012 00:33:28 +0000 (16:33 -0800)
commita9163b32b7db0646fd14f16bffd201fab42782b2
tree34d3d12a5f70d381c7beca494cb02efba09b2257
parent59bd70a4b77b8af88e36d22dd9ca7c28032e9f76
xhci: Fix potential NULL ptr deref in command cancellation.

commit 43a09f7fb01fa1e091416a2aa49b6c666458c1ee upstream.

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 b63f4053cc8aa22a98e3f9a97845afe6c15d0a0d "xHCI:
handle command after aborting the command ring".

Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Guangyu Sun <guangyu.sun@oracle.com>
drivers/usb/host/xhci-ring.c