xhci: check control context is valid before dereferencing it.
authorMathias Nyman <mathias.nyman@linux.intel.com>
Tue, 6 Apr 2021 07:02:06 +0000 (10:02 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 11 May 2021 12:47:19 +0000 (14:47 +0200)
commit98599e1045c27c5b659d2fa329d5249fbd78565d
tree5d30e8eb9d4782a9af5e92eea4db8533c99aa89a
parent2b195c32bccd40663d2cf7e651ca955e80d42ba6
xhci: check control context is valid before dereferencing it.

[ Upstream commit 597899d2f7c5619c87185ee7953d004bd37fd0eb ]

Don't dereference ctrl_ctx before checking it's valid.
Issue reported by Klockwork

Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Link: https://lore.kernel.org/r/20210406070208.3406266-3-mathias.nyman@linux.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/usb/host/xhci.c