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

Author: Philippe Gerum <r...@xenomai.org>
Date:   Tue Sep  3 12:08:30 2013 +0200

cobalt/posix/clock: fix clock_getres() to accept NULL output address

---

 kernel/cobalt/posix/clock.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/kernel/cobalt/posix/clock.c b/kernel/cobalt/posix/clock.c
index ace7b0c..1bf21da 100644
--- a/kernel/cobalt/posix/clock.c
+++ b/kernel/cobalt/posix/clock.c
@@ -174,7 +174,7 @@ int cobalt_clock_getres(clockid_t clock_id, struct timespec 
__user *u_ts)
                ns2ts(&ts, ns);
        }
 
-       if (__xn_safe_copy_to_user(u_ts, &ts, sizeof(ts)))
+       if (u_ts && __xn_safe_copy_to_user(u_ts, &ts, sizeof(ts)))
                return -EFAULT;
 
        return 0;


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

Reply via email to