Module: xenomai-jki
Branch: for-upstream
Commit: d4fb6b870c4efbb0d97860a7bf025b3fab7d5cc4
URL:    
http://git.xenomai.org/?p=xenomai-jki.git;a=commit;h=d4fb6b870c4efbb0d97860a7bf025b3fab7d5cc4

Author: Jan Kiszka <jan.kis...@siemens.com>
Date:   Fri Jun 18 19:33:58 2010 +0200

RTDM: Protect xnshadow_ppd_get via nklock

xnshadow_ppd_get must only be called while holding nklock and having
IRQs disabled. Fix this in create_instance.

Signed-off-by: Jan Kiszka <jan.kis...@siemens.com>

---

 ksrc/skins/rtdm/core.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/ksrc/skins/rtdm/core.c b/ksrc/skins/rtdm/core.c
index 11102e2..649fd2b 100644
--- a/ksrc/skins/rtdm/core.c
+++ b/ksrc/skins/rtdm/core.c
@@ -163,7 +163,9 @@ static int create_instance(struct rtdm_device *device,
        atomic_set(&context->close_lock_count, 1);
 
 #ifdef CONFIG_XENO_OPT_PERVASIVE
+       xnlock_get_irqsave(&nklock, s);
        ppd = xnshadow_ppd_get(__rtdm_muxid);
+       xnlock_put_irqrestore(&nklock, s);
 #endif /* CONFIG_XENO_OPT_PERVASIVE */
 
        context->reserved.owner =


_______________________________________________
Xenomai-git mailing list
Xenomai-git@gna.org
https://mail.gna.org/listinfo/xenomai-git

Reply via email to