Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b09ac64b authored by David Vrabel's avatar David Vrabel
Browse files

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

parent 6a4b5870
Loading
Loading
Loading
Loading
+5 −3
Original line number Diff line number Diff line
@@ -50,6 +50,7 @@ int whc_do_gencmd(struct whc *whc, u32 cmd, u32 params, void *addr, size_t len)
	unsigned long flags;
	dma_addr_t dma_addr;
	int t;
	int ret = 0;

	mutex_lock(&whc->mutex);

@@ -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",
			le_readl(whc->base + WUSBGENCMDSTS),
			le_readl(whc->base + WUSBGENCMDPARAMS));
		return -ETIMEDOUT;
		ret = -ETIMEDOUT;
		goto out;
	}

	if (addr) {
@@ -80,8 +82,8 @@ int whc_do_gencmd(struct whc *whc, u32 cmd, u32 params, void *addr, size_t len)
		  whc->base + WUSBGENCMDSTS);

	spin_unlock_irqrestore(&whc->lock, flags);

out:
	mutex_unlock(&whc->mutex);

	return 0;
	return ret;
}