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

Author: Philippe Gerum <r...@xenomai.org>
Date:   Thu Aug 14 11:56:58 2014 +0200

drivers/autotune: fix EFAULT on reset operation

---

 kernel/drivers/autotune/autotune.c |    8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/kernel/drivers/autotune/autotune.c 
b/kernel/drivers/autotune/autotune.c
index 13741d1..69ed0c1 100644
--- a/kernel/drivers/autotune/autotune.c
+++ b/kernel/drivers/autotune/autotune.c
@@ -516,9 +516,11 @@ static int autotune_ioctl_nrt(struct rtdm_fd *fd, unsigned 
int request, void *ar
        struct gravity_tuner *tuner;
        int period, ret;
 
-       ret = rtdm_copy_from_user(fd, &setup, arg, sizeof(setup));
-       if (ret)
-               return ret;
+       if (request != AUTOTUNE_RTIOC_RESET) {
+               ret = rtdm_copy_from_user(fd, &setup, arg, sizeof(setup));
+               if (ret)
+                       return ret;
+       }
 
        context = rtdm_fd_to_private(fd);
 


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

Reply via email to