提交 b09ac64b 编写于 作者: D David Vrabel

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

Signed-off-by: NDavid Vrabel <david.vrabel@csr.com>
上级 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% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册