Module: xenomai-forge
Branch: next
Commit: 80d2cb60cb121f9448cea11303ed2bb2fbd4e729
URL:    
http://git.xenomai.org/?p=xenomai-forge.git;a=commit;h=80d2cb60cb121f9448cea11303ed2bb2fbd4e729

Author: Philippe Gerum <r...@xenomai.org>
Date:   Sun Dec 29 12:47:24 2013 +0100

cobalt/shadow: fix caller of xnsys_ppd_get()

---

 kernel/cobalt/shadow.c |    5 +++++
 1 file changed, 5 insertions(+)

diff --git a/kernel/cobalt/shadow.c b/kernel/cobalt/shadow.c
index 0a40e83..8ae830d 100644
--- a/kernel/cobalt/shadow.c
+++ b/kernel/cobalt/shadow.c
@@ -1568,6 +1568,9 @@ static int xnshadow_sys_heap_info(struct xnheap_desc 
__user *u_hd,
 {
        struct xnheap_desc hd;
        struct xnheap *heap;
+       spl_t s;
+
+       xnlock_get_irqsave(&nklock, s);
 
        switch(heap_nr) {
        case XNHEAP_PROC_PRIVATE_HEAP:
@@ -1578,6 +1581,7 @@ static int xnshadow_sys_heap_info(struct xnheap_desc 
__user *u_hd,
                heap = &kheap;
                break;
        default:
+               xnlock_put_irqrestore(&nklock, s);
                return -EINVAL;
        }
 
@@ -1585,6 +1589,7 @@ static int xnshadow_sys_heap_info(struct xnheap_desc 
__user *u_hd,
        hd.size = xnheap_extentsize(heap);
        hd.area = xnheap_base_memory(heap);
        hd.used = xnheap_used_mem(heap);
+       xnlock_put_irqrestore(&nklock, s);
 
        return __xn_safe_copy_to_user(u_hd, &hd, sizeof(*u_hd));
 }


_______________________________________________
Xenomai-git mailing list
Xenomai-git@xenomai.org
http://www.xenomai.org/mailman/listinfo/xenomai-git

Reply via email to