Module: xenomai-head Branch: master Commit: 6c7272e0c695034ac62267f3b563c902ae95df79 URL: http://git.xenomai.org/?p=xenomai-head.git;a=commit;h=6c7272e0c695034ac62267f3b563c902ae95df79
Author: Philippe Gerum <r...@xenomai.org> Date: Tue Nov 3 10:27:56 2009 +0100 nucleus: set vma private data early enough We have to set vma->vm_private_data before the error path could be taken, since xnheap_vmclose() fetches it. --- ksrc/nucleus/heap.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/ksrc/nucleus/heap.c b/ksrc/nucleus/heap.c index 37bb633..b5fb1cd 100644 --- a/ksrc/nucleus/heap.c +++ b/ksrc/nucleus/heap.c @@ -1096,6 +1096,8 @@ static int xnheap_mmap(struct file *file, struct vm_area_struct *vma) spin_unlock(&kheapq_lock); + vma->vm_private_data = file->private_data; + err = -ENXIO; if (offset + size > xnheap_extentsize(heap)) goto deref_out; @@ -1106,7 +1108,6 @@ static int xnheap_mmap(struct file *file, struct vm_area_struct *vma) goto deref_out; vma->vm_ops = &xnheap_vmops; - vma->vm_private_data = file->private_data; #ifdef CONFIG_MMU vaddr = (unsigned long)heap->archdep.heapbase + offset; _______________________________________________ Xenomai-git mailing list Xenomai-git@gna.org https://mail.gna.org/listinfo/xenomai-git