Skip to contentSkip to conversation

usb: xhci: fix return value of xhci_setup_device()

PATCH Superseded Lu Baolu 2 participants 4 messages Sep 7, 2016

Subsystems (3)

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore

Lu Baolu

author
#0 lore raw

PATCH 1/1 usb: xhci: fix return value of xhci_setup_device()

From: "Lu, Baolu" <[email protected]>

xhci_setup_device() should return failure with correct error number when xhci host has died, removed or halted.

---
 drivers/usb/host/xhci.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/usb/host/xhci.c +3 -1
index 01d96c9..3e66e73 100644
@@ -3785,8 +3785,10 @@ static int xhci_setup_device(struct usb_hcd *hcd, struct usb_device *udev,
 
 	mutex_lock(&xhci->mutex);
 
-	if (xhci->xhc_state)	/* dying, removing or halted */
+	if (xhci->xhc_state) {	/* dying, removing or halted */
+		ret = -ESHUTDOWN;
 		goto out;
+	}
 
 	if (!udev->slot_id) {
 		xhci_dbg_trace(xhci, trace_xhci_dbg_address,
Signature · 1 line
2.1.4
#1 lore raw
Quoted 5 lines · Lu Baolu

From: "Lu, Baolu" <[email protected]>

xhci_setup_device() should return failure with correct error number when xhci host has died, removed or halted.

Thanks, will add.
Might go to 4.9 as 4.8-rc5 is already out

-Mathias

author
#2 lore raw

Hi Mathias,

Quoted 9 lines · Mathias Nyman
Quoted 5 lines · Lu Baolu

From: "Lu, Baolu" <[email protected]>

xhci_setup_device() should return failure with correct error number when xhci host has died, removed or halted.

Thanks, will add.
Might go to 4.9 as 4.8-rc5 is already out

I'm sorry, I just realized that "From" signature is different from "Signed-off-by" signature in this patch.

Do you mind if I resend this patch with this fixed?

Best regards,
Lu Baolu

#3 lore raw
Quoted 10 lines · Lu Baolu

Hi Mathias,

Quoted 7 lines · Mathias Nyman
Quoted 5 lines · Lu Baolu

From: "Lu, Baolu" <[email protected]>

xhci_setup_device() should return failure with correct error number when xhci host has died, removed or halted.

Quoted 8 lines
Quoted 2 lines

Thanks, will add.
Might go to 4.9 as 4.8-rc5 is already out

I'm sorry, I just realized that "From" signature is different from "Signed-off-by" signature in this patch.

Do you mind if I resend this patch with this fixed?

Not at all, I'll take v2

-Mathias