diff options
author | Vivek Gautam <gautam.vivek@samsung.com> | 2012-09-22 08:41:19 -0400 |
---|---|---|
committer | Sarah Sharp <sarah.a.sharp@linux.intel.com> | 2012-09-24 15:11:10 -0400 |
commit | 457a73d346187c2cc5d599072f38676f18f130e0 (patch) | |
tree | 9fa4071f95ea19201ae1d867a9253db50a4897d4 /drivers/usb/host/xhci.c | |
parent | a6e097dfdfd189b6929af6efa1d289af61858386 (diff) |
usb: host: xhci: Fix Null pointer dereferencing with 71c731a for non-x86 systems
In 71c731a: usb: host: xhci: Fix Compliance Mode on SN65LVPE502CP Hardware
when extracting DMI strings (vendor or product_name) to mark them as quirk
we may get NULL pointer in case of non-x86 systems which won't define
CONFIG_DMI. Hence susbsequent strstr() calls crash while driver probing.
So, returning 'false' here in case we get a NULL vendor or product_name.
This is tested with ARM (exynos) system.
This patch should be backported to stable kernels as old as 3.6, that
contain the commit 71c731a296f1b08a3724bd1b514b64f1bda87a23 "usb: host:
xhci: Fix Compliance Mode on SN65LVPE502CP Hardware"
Signed-off-by: Vivek Gautam <gautam.vivek@samsung.com>
Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
Reported-by: Sebastian Gottschall (DD-WRT) <s.gottschall@dd-wrt.com>
Cc: stable@vger.kernel.org
Diffstat (limited to 'drivers/usb/host/xhci.c')
-rw-r--r-- | drivers/usb/host/xhci.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c index 52b04b0880c3..8d7fcbbe6ade 100644 --- a/drivers/usb/host/xhci.c +++ b/drivers/usb/host/xhci.c | |||
@@ -471,6 +471,8 @@ static bool compliance_mode_recovery_timer_quirk_check(void) | |||
471 | 471 | ||
472 | dmi_product_name = dmi_get_system_info(DMI_PRODUCT_NAME); | 472 | dmi_product_name = dmi_get_system_info(DMI_PRODUCT_NAME); |
473 | dmi_sys_vendor = dmi_get_system_info(DMI_SYS_VENDOR); | 473 | dmi_sys_vendor = dmi_get_system_info(DMI_SYS_VENDOR); |
474 | if (!dmi_product_name || !dmi_sys_vendor) | ||
475 | return false; | ||
474 | 476 | ||
475 | if (!(strstr(dmi_sys_vendor, "Hewlett-Packard"))) | 477 | if (!(strstr(dmi_sys_vendor, "Hewlett-Packard"))) |
476 | return false; | 478 | return false; |