diff options
author | Andy Shevchenko <andriy.shevchenko@linux.intel.com> | 2023-12-01 18:06:33 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2023-12-04 09:50:40 +0300 |
commit | 24352d170b5fcab1d7724dd20257e0b73cbdb453 (patch) | |
tree | f229bf114db4dc4fde4f75da56147da26181757a /drivers/usb/host/xhci-dbgcap.c | |
parent | e3be8fb7d012d1e9a1d1b753ca50ff057bbb12b2 (diff) | |
download | linux-24352d170b5fcab1d7724dd20257e0b73cbdb453.tar.xz |
xhci: dbc: Check for errors first in xhci_dbc_stop()
The usual pattern is to check for errors and then continue if none.
Apply that pattern to xhci_dbc_stop() code.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Link: https://lore.kernel.org/r/20231201150647.1307406-6-mathias.nyman@linux.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/host/xhci-dbgcap.c')
-rw-r--r-- | drivers/usb/host/xhci-dbgcap.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/usb/host/xhci-dbgcap.c b/drivers/usb/host/xhci-dbgcap.c index 660e3ee31dc6..6b9f4b839270 100644 --- a/drivers/usb/host/xhci-dbgcap.c +++ b/drivers/usb/host/xhci-dbgcap.c @@ -646,11 +646,11 @@ static void xhci_dbc_stop(struct xhci_dbc *dbc) spin_lock_irqsave(&dbc->lock, flags); ret = xhci_do_dbc_stop(dbc); spin_unlock_irqrestore(&dbc->lock, flags); + if (ret) + return; - if (!ret) { - xhci_dbc_mem_cleanup(dbc); - pm_runtime_put_sync(dbc->dev); /* note, was self.controller */ - } + xhci_dbc_mem_cleanup(dbc); + pm_runtime_put_sync(dbc->dev); /* note, was self.controller */ } static void |