aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb
diff options
context:
space:
mode:
authorDavid Vrabel <david.vrabel@csr.com>2008-10-27 11:14:03 -0400
committerDavid Vrabel <david.vrabel@csr.com>2008-10-28 08:06:59 -0400
commitb09ac64b7b2d93efab3998033588f5cb0e470ccf (patch)
tree9b4148f5010a4a45f2a835681f7269fe49ce1393 /drivers/usb
parent6a4b58707903cb0901966ac8dad5d6ec7f2d432f (diff)
wusb: release mutex in the error path of whci-hcd's whc_do_gencmd()
Signed-off-by: David Vrabel <david.vrabel@csr.com>
Diffstat (limited to 'drivers/usb')
-rw-r--r--drivers/usb/host/whci/hw.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/usb/host/whci/hw.c b/drivers/usb/host/whci/hw.c
index ac86e59c1225..d498e7203217 100644
--- a/drivers/usb/host/whci/hw.c
+++ b/drivers/usb/host/whci/hw.c
@@ -50,6 +50,7 @@ int whc_do_gencmd(struct whc *whc, u32 cmd, u32 params, void *addr, size_t len)
50 unsigned long flags; 50 unsigned long flags;
51 dma_addr_t dma_addr; 51 dma_addr_t dma_addr;
52 int t; 52 int t;
53 int ret = 0;
53 54
54 mutex_lock(&whc->mutex); 55 mutex_lock(&whc->mutex);
55 56
@@ -61,7 +62,8 @@ int whc_do_gencmd(struct whc *whc, u32 cmd, u32 params, void *addr, size_t len)
61 dev_err(&whc->umc->dev, "generic command timeout (%04x/%04x)\n", 62 dev_err(&whc->umc->dev, "generic command timeout (%04x/%04x)\n",
62 le_readl(whc->base + WUSBGENCMDSTS), 63 le_readl(whc->base + WUSBGENCMDSTS),
63 le_readl(whc->base + WUSBGENCMDPARAMS)); 64 le_readl(whc->base + WUSBGENCMDPARAMS));
64 return -ETIMEDOUT; 65 ret = -ETIMEDOUT;
66 goto out;
65 } 67 }
66 68
67 if (addr) { 69 if (addr) {
@@ -80,8 +82,8 @@ int whc_do_gencmd(struct whc *whc, u32 cmd, u32 params, void *addr, size_t len)
80 whc->base + WUSBGENCMDSTS); 82 whc->base + WUSBGENCMDSTS);
81 83
82 spin_unlock_irqrestore(&whc->lock, flags); 84 spin_unlock_irqrestore(&whc->lock, flags);
83 85out:
84 mutex_unlock(&whc->mutex); 86 mutex_unlock(&whc->mutex);
85 87
86 return 0; 88 return ret;
87} 89}