Message ID | 86f265cb7e18410994e433ad522c0cf1@SVR-IES-MBX-03.mgc.mentorg.com (mailing list archive) |
---|---|
State | Mainlined |
Commit | 7aa1bb2ffd84d6b9b5f546b079bb15cd0ab6e76e |
Headers | show |
Series | Resend: [PATCH] usb: xhci: avoid null pointer deref when bos field is NULL | expand |
On 7.5.2019 11.15, Schmid, Carsten wrote: > Hi, > > two weeks ago i sent this mail to the linux-usb mailing list but got no answer. > Maybe this has fallen through your filters? > > So resending it and adding Mathias in CC. Thanks, I notice them better when I'm added as To or CC. Adding patch to queue We're late in 5.1 cycle so it will go forward after 5.2-rc1 For future patches please add comments not suitable for changelog after a marker line, as submitting-patches.rst suggest: - The ``Signed-off-by:`` lines, described above, which will also go in the changelog. - A marker line containing simply ``---``. - Any additional comments not suitable for the changelog. - The actual patch (``diff`` output). Thanks -Mathias
diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c index 7fa58c9..981d1a8 100644 --- a/drivers/usb/host/xhci.c +++ b/drivers/usb/host/xhci.c @@ -4289,7 +4289,6 @@ static int xhci_set_usb2_hardware_lpm(struct usb_hcd *hcd, pm_addr = ports[port_num]->addr + PORTPMSC; pm_val = readl(pm_addr); hlpm_addr = ports[port_num]->addr + PORTHLPMC; - field = le32_to_cpu(udev->bos->ext_cap->bmAttributes); xhci_dbg(xhci, "%s port %d USB2 hardware LPM\n", enable ? "enable" : "disable", port_num + 1); @@ -4301,6 +4300,7 @@ static int xhci_set_usb2_hardware_lpm(struct usb_hcd *hcd, * default one which works with mixed HIRD and BESL * systems. See XHCI_DEFAULT_BESL definition in xhci.h */ + field = le32_to_cpu(udev->bos->ext_cap->bmAttributes); if ((field & USB_BESL_SUPPORT) && (field & USB_BESL_BASELINE_VALID)) hird = USB_GET_BESL_BASELINE(field);