From: "Jianxing.Wang" <wangjianxing5...@163.com>

When notebook with intel-3165-wifi suspend and resume,crash for
udev->bos is NULL.

Signed-off-by: Jianxing.Wang <wangjianxing5...@163.com>
---
 drivers/usb/core/hub.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c
index 5286bf6..3b5493a 100644
--- a/drivers/usb/core/hub.c
+++ b/drivers/usb/core/hub.c
@@ -4281,10 +4281,12 @@ static void hub_set_initial_usb2_lpm_policy(struct 
usb_device *udev)
        if (hub)
                connect_type = hub->ports[udev->portnum - 1]->connect_type;
 
-       if ((udev->bos->ext_cap->bmAttributes & cpu_to_le32(USB_BESL_SUPPORT)) 
||
-                       connect_type == USB_PORT_CONNECT_TYPE_HARD_WIRED) {
-               udev->usb2_hw_lpm_allowed = 1;
-               usb_set_usb2_hardware_lpm(udev, 1);
+       if (udev->bos != NULL) {
+               if ((udev->bos->ext_cap->bmAttributes & 
cpu_to_le32(USB_BESL_SUPPORT)) ||
+                               connect_type == 
USB_PORT_CONNECT_TYPE_HARD_WIRED) {
+                       udev->usb2_hw_lpm_allowed = 1;
+                       usb_set_usb2_hardware_lpm(udev, 1);
+               }
        }
 }
 
-- 
2.7.4


--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to