提交 1866b545 编写于 作者: J Janusz Krzysztofik 提交者: Tony Lindgren

omap: McBSP: Fix possible port lockout

In its current form, the omap_mcbsp_request() function can return after
irq_request() failure without any cleanups, effectively locking out the port
forever with clocks left running. Fix it.
Signed-off-by: NJanusz Krzysztofik <jkrzyszt@tis.icnet.pl>
Acked-by: NJarkko Nikula <jhnikula@gmail.com>
Acked-by: NPeter Ujfalusi <peter.ujfalusi@nokia.com>
Signed-off-by: NTony Lindgren <tony@atomide.com>
上级 74d2e4f8
......@@ -436,7 +436,7 @@ int omap_mcbsp_request(unsigned int id)
dev_err(mcbsp->dev, "Unable to request TX IRQ %d "
"for McBSP%d\n", mcbsp->tx_irq,
mcbsp->id);
return err;
goto error;
}
init_completion(&mcbsp->rx_irq_completion);
......@@ -446,12 +446,26 @@ int omap_mcbsp_request(unsigned int id)
dev_err(mcbsp->dev, "Unable to request RX IRQ %d "
"for McBSP%d\n", mcbsp->rx_irq,
mcbsp->id);
free_irq(mcbsp->tx_irq, (void *)mcbsp);
return err;
goto tx_irq;
}
}
return 0;
tx_irq:
free_irq(mcbsp->tx_irq, (void *)mcbsp);
error:
if (mcbsp->pdata && mcbsp->pdata->ops && mcbsp->pdata->ops->free)
mcbsp->pdata->ops->free(id);
/* Do procedure specific to omap34xx arch, if applicable */
omap34xx_mcbsp_free(mcbsp);
clk_disable(mcbsp->fclk);
clk_disable(mcbsp->iclk);
mcbsp->free = 1;
return err;
}
EXPORT_SYMBOL(omap_mcbsp_request);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册