* [PATCH] ARM: OMAP: mailbox module stability fix
@ 2006-11-30 11:06 Toshihiro.Kobayashi
2006-11-30 23:28 ` Tony Lindgren
0 siblings, 1 reply; 2+ messages in thread
From: Toshihiro.Kobayashi @ 2006-11-30 11:06 UTC (permalink / raw)
To: linux-omap-open-source, hiroshi.doyu
mbox objects must be initialized before request_irq().
Signed-off-by: Toshihiro Kobayashi <toshihiro.kobayashi@nokia.com>
---
arch/arm/plat-omap/mailbox.c | 25 ++++++++++++++-----------
1 files changed, 14 insertions(+), 11 deletions(-)
efafc71d75f2dd9572be38f052171dc1b083bd4e
diff --git a/arch/arm/plat-omap/mailbox.c b/arch/arm/plat-omap/mailbox.c
index 1d3761f..723c92f 100644
--- a/arch/arm/plat-omap/mailbox.c
+++ b/arch/arm/plat-omap/mailbox.c
@@ -238,30 +238,32 @@ static int omap_mbox_init(struct omap_mb
goto fail1;
}
+ spin_lock_init(&mbox->lock);
+ INIT_WORK(&mbox->msg_receive, mbox_msg_receiver, mbox);
+ init_waitqueue_head(&mbox->tx_waitq);
+
+ ret = mbq_init(&mbox->mbq);
+ if (unlikely(ret))
+ goto fail2;
+
ret = request_irq(mbox->irq, mbox_interrupt, SA_INTERRUPT,
mbox->name, mbox);
if (unlikely(ret)) {
printk(KERN_ERR
"failed to register mailbox interrupt:%d\n",
ret);
- goto fail1;
+ goto fail3;
}
disable_mbox_irq(mbox, IRQ_RX);
enable_mbox_irq(mbox, IRQ_RX);
- spin_lock_init(&mbox->lock);
- INIT_WORK(&mbox->msg_receive, mbox_msg_receiver, mbox);
- init_waitqueue_head(&mbox->tx_waitq);
-
- ret = mbq_init(&mbox->mbq);
- if (unlikely(ret))
- goto fail2;
-
return 0;
+
+ fail3:
+ kfree(mbox->mbq);
fail2:
- free_irq(mbox->irq, mbox);
class_remove_file(&omap_mbox_class, &class_attr_mbox);
- class_unregister(&omap_mbox_class);
fail1:
+ class_unregister(&omap_mbox_class);
if (unlikely(mbox->ops->shutdown))
mbox->ops->shutdown(mbox);
@@ -271,6 +273,7 @@ static int omap_mbox_init(struct omap_mb
static void omap_mbox_shutdown(struct omap_mbox *mbox)
{
free_irq(mbox->irq, mbox);
+ kfree(mbox->mbq);
class_remove_file(&omap_mbox_class, &class_attr_mbox);
class_unregister(&omap_mbox_class);
--
1.3.3
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2006-11-30 23:28 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-11-30 11:06 [PATCH] ARM: OMAP: mailbox module stability fix Toshihiro.Kobayashi
2006-11-30 23:28 ` Tony Lindgren
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox