]> git.baikalelectronics.ru Git - kernel.git/commit
usb: host: xhci-plat: fix NULL pointer in probe for device tree case
authorGregory CLEMENT <gregory.clement@free-electrons.com>
Tue, 26 Jan 2016 15:50:11 +0000 (17:50 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 3 Feb 2016 22:01:47 +0000 (14:01 -0800)
commitc4d9de4c536b6ef9d225170763099fce82ff7225
treeda813026a36e2dd49343045d470ee1a7b4db48b7
parent14c6c5d667a89c8e7e8f6a464e0bd83c1feb1dc8
usb: host: xhci-plat: fix NULL pointer in probe for device tree case

During probe, in the device tree case, the data pointer associated to a
compatible is dereferenced. However, not all the compatibles are
associated to a private data pointer.

The generic-xhci and the xhci-platform don't need them, this patch adds a
test on the data pointer before accessing it, avoiding a kernel crash.

Fixes: 5cd129162fb8 ("usb: host: xhci-plat: add struct xhci_plat_priv")
Cc: stable@vger.kernel.org
Signed-off-by: Gregory CLEMENT <gregory.clement@free-electrons.com>
Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/host/xhci-plat.c