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

Author: Philippe Gerum <r...@xenomai.org>
Date:   Fri May 16 16:22:27 2014 +0200

cobalt/posix: silence spurious warnings

---

 kernel/cobalt/posix/clock.c   |    2 +-
 kernel/cobalt/posix/mqueue.c  |   22 +++++++++++++---------
 kernel/cobalt/posix/timerfd.c |    2 +-
 3 files changed, 15 insertions(+), 11 deletions(-)

diff --git a/kernel/cobalt/posix/clock.c b/kernel/cobalt/posix/clock.c
index 951daf8..8f06a3a 100644
--- a/kernel/cobalt/posix/clock.c
+++ b/kernel/cobalt/posix/clock.c
@@ -219,7 +219,7 @@ int cobalt_clock_gettime(clockid_t clock_id, struct 
timespec __user *u_ts)
 int cobalt_clock_settime(clockid_t clock_id, const struct timespec __user 
*u_ts)
 {
        struct timespec ts;
-       int _ret, ret;
+       int _ret, ret = 0;
        xnticks_t now;
        spl_t s;
 
diff --git a/kernel/cobalt/posix/mqueue.c b/kernel/cobalt/posix/mqueue.c
index 76e9155..48a1c7a 100644
--- a/kernel/cobalt/posix/mqueue.c
+++ b/kernel/cobalt/posix/mqueue.c
@@ -1186,18 +1186,18 @@ int cobalt_mq_timedreceive(mqd_t uqd, void __user 
*u_buf,
 
        if (__xn_get_user(len, u_len)) {
                err = -EFAULT;
-               goto out;
+               goto fail;
        }
 
        if (len > 0 && !access_wok(u_buf, len)) {
                err = -EFAULT;
-               goto out;
+               goto fail;
        }
 
        if (u_ts) {
                if (__xn_safe_copy_from_user(&timeout, u_ts, sizeof(timeout))) {
                        err = -EFAULT;
-                       goto out;
+                       goto fail;
                }
 
                timeoutp = &timeout;
@@ -1207,23 +1207,22 @@ int cobalt_mq_timedreceive(mqd_t uqd, void __user 
*u_buf,
        msg = cobalt_mq_timedrcv_inner(mqd, len, timeoutp);
        if (IS_ERR(msg)) {
                err = PTR_ERR(msg);
-               goto out;
+               goto fail;
        }
 
        if (__xn_copy_to_user(u_buf, msg->data, msg->len)) {
                cobalt_mq_finish_rcv(mqd, msg);
                err = -EFAULT;
-               goto out;
+               goto fail;
        }
+
        len = msg->len;
        prio = msg->prio;
-
        err = cobalt_mq_finish_rcv(mqd, msg);
+       if (err)
+               goto fail;
 
-  out:
        cobalt_mqd_put(mqd);
-       if (err)
-               return err;
 
        if (__xn_put_user(len, u_len))
                return -EFAULT;
@@ -1232,6 +1231,11 @@ int cobalt_mq_timedreceive(mqd_t uqd, void __user *u_buf,
                return -EFAULT;
 
        return 0;
+
+fail:
+       cobalt_mqd_put(mqd);
+
+       return err;
 }
 
 int cobalt_mq_pkg_init(void)
diff --git a/kernel/cobalt/posix/timerfd.c b/kernel/cobalt/posix/timerfd.c
index 2c1fdd8..3ffd8de 100644
--- a/kernel/cobalt/posix/timerfd.c
+++ b/kernel/cobalt/posix/timerfd.c
@@ -43,7 +43,7 @@ struct cobalt_tfd {
 static ssize_t timerfd_read(struct rtdm_fd *fd, void __user *buf, size_t size)
 {
        unsigned long long __user *u_ticks;
-       unsigned long long ticks;
+       unsigned long long ticks = 0;
        struct cobalt_tfd *tfd;
        bool aligned;
        spl_t s;


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

Reply via email to