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

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..8e9b040 100644
--- a/kernel/drivers/autotune/autotune.c
+++ b/kernel/drivers/autotune/autotune.c
@@ -516,6 +516,11 @@ static int autotune_ioctl_nrt(struct rtdm_fd *fd, unsigned 
int request, void *ar
        struct gravity_tuner *tuner;
        int period, ret;
 
+       if (request == AUTOTUNE_RTIOC_RESET) {
+               xnclock_reset_gravity(&nkclock);
+               return 0;
+       }
+
        ret = rtdm_copy_from_user(fd, &setup, arg, sizeof(setup));
        if (ret)
                return ret;
@@ -539,9 +544,6 @@ static int autotune_ioctl_nrt(struct rtdm_fd *fd, unsigned 
int request, void *ar
        case AUTOTUNE_RTIOC_USER:
                tuner = &uthread_tuner.tuner;
                break;
-       case AUTOTUNE_RTIOC_RESET:
-               xnclock_reset_gravity(&nkclock);
-               return 0;
        default:
                return -EINVAL;
        }


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

Reply via email to