Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1697666 > unrolled thread

[PATCH v2 4/5] usb: xhci: Return error when host is dead in xhci_disable_slot()

Started byLu Baolu <baolu.lu@linux.intel.com>
First post2017-07-27 04:30 +0200
Last post2017-07-27 04:30 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH v2 4/5] usb: xhci: Return error when host is dead in xhci_disable_slot() Lu Baolu <baolu.lu@linux.intel.com> - 2017-07-27 04:30 +0200

#1697666 — [PATCH v2 4/5] usb: xhci: Return error when host is dead in xhci_disable_slot()

FromLu Baolu <baolu.lu@linux.intel.com>
Date2017-07-27 04:30 +0200
Subject[PATCH v2 4/5] usb: xhci: Return error when host is dead in xhci_disable_slot()
Message-ID<u7GIN-em-11@gated-at.bofh.it>
xhci_disable_slot() is a helper for disabling a slot when a device
goes away or recovers from error situations. Currently, it returns
success when it sees a dead host. This is not the right way to go.
It should return error and let the invoker know that disable slot
command was failed due to a dead host.

Fixes: f9e609b82479 ("usb: xhci: Add helper function xhci_disable_slot().")
Cc: Guoqing Zhang <guoqing.zhang@intel.com>
Signed-off-by: Lu Baolu <baolu.lu@linux.intel.com>
---
 drivers/usb/host/xhci.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c
index 2df601e..d6b728d 100644
--- a/drivers/usb/host/xhci.c
+++ b/drivers/usb/host/xhci.c
@@ -3568,10 +3568,9 @@ int xhci_disable_slot(struct xhci_hcd *xhci, u32 slot_id)
 	state = readl(&xhci->op_regs->status);
 	if (state == 0xffffffff || (xhci->xhc_state & XHCI_STATE_DYING) ||
 			(xhci->xhc_state & XHCI_STATE_HALTED)) {
-		xhci_free_virt_device(xhci, slot_id);
 		spin_unlock_irqrestore(&xhci->lock, flags);
 		kfree(command);
-		return ret;
+		return -ENODEV;
 	}
 
 	ret = xhci_queue_slot_control(xhci, command, TRB_DISABLE_SLOT,
-- 
2.7.4

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web