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

Author: Jorge Ramirez-Ortiz <j...@xenomai.org>
Date:   Sat Jun  7 20:22:50 2014 -0400

rtdm/analogy: fix oops - check file descriptor validity before using it.

---

 include/cobalt/kernel/rtdm/analogy/buffer.h |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/include/cobalt/kernel/rtdm/analogy/buffer.h 
b/include/cobalt/kernel/rtdm/analogy/buffer.h
index ee26283..3003a4f 100644
--- a/include/cobalt/kernel/rtdm/analogy/buffer.h
+++ b/include/cobalt/kernel/rtdm/analogy/buffer.h
@@ -107,7 +107,7 @@ static inline int __produce(struct a4l_device_context *cxt,
                        buf->size - start_ptr : tmp_cnt;
 
                /* Perform the copy */
-               if (rtdm_fd_is_user(fd) == 0)
+               if (cxt == NULL)
                        memcpy(buf->buf + start_ptr, pin, blk_size);
                else
                        ret = rtdm_safe_copy_from_user(fd,
@@ -140,7 +140,7 @@ static inline int __consume(struct a4l_device_context *cxt,
                        buf->size - start_ptr : tmp_cnt;
 
                /* Perform the copy */
-               if (rtdm_fd_is_user(fd) == 0)
+               if (cxt == NULL)
                        memcpy(pout, buf->buf + start_ptr, blk_size);
                else
                        ret = rtdm_safe_copy_to_user(fd,


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

Reply via email to