Module: xenomai-3
Branch: next
Commit: 938b7002eefa17fdd1601bf38dcbe4220ffb9b47
URL:    
http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=938b7002eefa17fdd1601bf38dcbe4220ffb9b47

Author: Philippe Gerum <r...@xenomai.org>
Date:   Wed Dec 30 11:24:28 2015 +0100

drivers/switchtest: stop timers before releasing task data

---

 kernel/drivers/testing/switchtest.c |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/kernel/drivers/testing/switchtest.c 
b/kernel/drivers/testing/switchtest.c
index 976b1f8..7283dd5 100644
--- a/kernel/drivers/testing/switchtest.c
+++ b/kernel/drivers/testing/switchtest.c
@@ -549,6 +549,9 @@ static void rtswitch_close(struct rtdm_fd *fd)
        struct rtswitch_context *ctx = rtdm_fd_to_private(fd);
        unsigned int i;
 
+       rtdm_timer_destroy(&ctx->wake_up_delay);
+       rtdm_nrtsig_destroy(&ctx->wake_utask);
+
        if (ctx->tasks) {
                set_cpus_allowed(current, *cpumask_of(ctx->cpu));
 
@@ -563,8 +566,6 @@ static void rtswitch_close(struct rtdm_fd *fd)
                }
                vfree(ctx->tasks);
        }
-       rtdm_timer_destroy(&ctx->wake_up_delay);
-       rtdm_nrtsig_destroy(&ctx->wake_utask);
 }
 
 static int rtswitch_ioctl_nrt(struct rtdm_fd *fd,


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

Reply via email to