Showing error 921

User: Jiri Slaby
Error type: Leaving function in locked state
Error type description: Some lock is not unlocked on all paths of a function, so it is leaked
File location: drivers/usb/host/whci/hw.c
Line in file: 64
Project: Linux Kernel
Project version: 2.6.28
Confirmation: Fixed by b09ac64b7b2d93efab3998033588f5cb0e470ccf
Tools: Stanse (1.2)
Entered: 2012-03-02 21:35:17 UTC


Source:

34        cmd = (cmd & ~mask) | val;
35        le_writel(cmd, whc->base + WUSBCMD);
36
37        spin_unlock_irqrestore(&whc->lock, flags);
38}
39
40/**
41 * whc_do_gencmd - start a generic command via the WUSBGENCMDSTS register
42 * @whc:    the WHCI HC
43 * @cmd:    command to start.
44 * @params: parameters for the command (the WUSBGENCMDPARAMS register value).
45 * @addr:   pointer to any data for the command (may be NULL).
46 * @len:    length of the data (if any).
47 */
48int whc_do_gencmd(struct whc *whc, u32 cmd, u32 params, void *addr, size_t len)
49{
50        unsigned long flags;
51        dma_addr_t dma_addr;
52        int t;
53
54        mutex_lock(&whc->mutex);
55
56        /* Wait for previous command to complete. */
57        t = wait_event_timeout(whc->cmd_wq,
58                               (le_readl(whc->base + WUSBGENCMDSTS) & WUSBGENCMDSTS_ACTIVE) == 0,
59                               WHC_GENCMD_TIMEOUT_MS);
60        if (t == 0) {
61                dev_err(&whc->umc->dev, "generic command timeout (%04x/%04x)\n",
62                        le_readl(whc->base + WUSBGENCMDSTS),
63                        le_readl(whc->base + WUSBGENCMDPARAMS));
64                return -ETIMEDOUT;
65        }
66
67        if (addr) {
68                memcpy(whc->gen_cmd_buf, addr, len);
69                dma_addr = whc->gen_cmd_buf_dma;
70        } else
71                dma_addr = 0;
72
73        /* Poke registers to start cmd. */
74        spin_lock_irqsave(&whc->lock, flags);
Show full sources