Commit b09ac64b authored by David Vrabel's avatar David Vrabel

wusb: release mutex in the error path of whci-hcd's whc_do_gencmd()

Signed-off-by: default avatarDavid Vrabel <david.vrabel@csr.com>
parent 6a4b5870
...@@ -50,6 +50,7 @@ int whc_do_gencmd(struct whc *whc, u32 cmd, u32 params, void *addr, size_t len) ...@@ -50,6 +50,7 @@ int whc_do_gencmd(struct whc *whc, u32 cmd, u32 params, void *addr, size_t len)
unsigned long flags; unsigned long flags;
dma_addr_t dma_addr; dma_addr_t dma_addr;
int t; int t;
int ret = 0;
mutex_lock(&whc->mutex); mutex_lock(&whc->mutex);
...@@ -61,7 +62,8 @@ int whc_do_gencmd(struct whc *whc, u32 cmd, u32 params, void *addr, size_t len) ...@@ -61,7 +62,8 @@ int whc_do_gencmd(struct whc *whc, u32 cmd, u32 params, void *addr, size_t len)
dev_err(&whc->umc->dev, "generic command timeout (%04x/%04x)\n", dev_err(&whc->umc->dev, "generic command timeout (%04x/%04x)\n",
le_readl(whc->base + WUSBGENCMDSTS), le_readl(whc->base + WUSBGENCMDSTS),
le_readl(whc->base + WUSBGENCMDPARAMS)); le_readl(whc->base + WUSBGENCMDPARAMS));
return -ETIMEDOUT; ret = -ETIMEDOUT;
goto out;
} }
if (addr) { if (addr) {
...@@ -80,8 +82,8 @@ int whc_do_gencmd(struct whc *whc, u32 cmd, u32 params, void *addr, size_t len) ...@@ -80,8 +82,8 @@ int whc_do_gencmd(struct whc *whc, u32 cmd, u32 params, void *addr, size_t len)
whc->base + WUSBGENCMDSTS); whc->base + WUSBGENCMDSTS);
spin_unlock_irqrestore(&whc->lock, flags); spin_unlock_irqrestore(&whc->lock, flags);
out:
mutex_unlock(&whc->mutex); mutex_unlock(&whc->mutex);
return 0; return ret;
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment