339b74a
From 07197eb61cfabc153846b1ae9d080a5d6c449d12 Mon Sep 17 00:00:00 2001
339b74a
From: "Du, Changbin" <changbin.du@intel.com>
339b74a
Date: Mon, 22 Feb 2016 10:08:36 +0800
339b74a
Subject: [PATCH] usb: hub: fix panic in usb_reset_and_verify_device
339b74a
339b74a
Signed-off-by: Du, Changbin <changbin.du@intel.com>
339b74a
---
339b74a
 drivers/usb/core/hub.c | 6 ++++--
339b74a
 1 file changed, 4 insertions(+), 2 deletions(-)
339b74a
339b74a
diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c
339b74a
index 350dcd9..045f951 100644
339b74a
--- a/drivers/usb/core/hub.c
339b74a
+++ b/drivers/usb/core/hub.c
339b74a
@@ -5501,8 +5501,10 @@ done:
339b74a
 	return 0;
339b74a
 
339b74a
 re_enumerate:
339b74a
-	usb_release_bos_descriptor(udev);
339b74a
-	udev->bos = bos;
339b74a
+	if (udev->bos != bos) {
339b74a
+		usb_release_bos_descriptor(udev);
339b74a
+		udev->bos = bos;
339b74a
+	}
339b74a
 re_enumerate_no_bos:
339b74a
 	/* LPM state doesn't matter when we're about to destroy the device. */
339b74a
 	hub_port_logical_disconnect(parent_hub, port1);
339b74a
-- 
339b74a
2.5.0
339b74a