Module: xenomai-abe
Branch: comedi
Commit: 5a4712e684bd0a3022307da03504948ab3488907
URL:    
http://git.xenomai.org/?p=xenomai-abe.git;a=commit;h=5a4712e684bd0a3022307da03504948ab3488907

Author: Alexis Berlemont <alexis.berlem...@gmail.com>
Date:   Fri Sep 18 23:49:09 2009 +0200

Add some basic check in comedi_get_cmd()

---

 ksrc/drivers/comedi/buffer.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/ksrc/drivers/comedi/buffer.c b/ksrc/drivers/comedi/buffer.c
index 5f6dd9e..edd9807 100644
--- a/ksrc/drivers/comedi/buffer.c
+++ b/ksrc/drivers/comedi/buffer.c
@@ -99,6 +99,11 @@ int comedi_alloc_buffer(comedi_buf_t * buf_desc)
 comedi_cmd_t *comedi_get_cmd(comedi_subd_t *subd)
 {
        comedi_dev_t *dev = subd->dev;
+
+       /* Check that subdevice supports commands */
+       if (dev->transfer.bufs == NULL)
+               return NULL;
+
        return dev->transfer.bufs[subd->idx]->cur_cmd;
 }
 


_______________________________________________
Xenomai-git mailing list
Xenomai-git@gna.org
https://mail.gna.org/listinfo/xenomai-git

Reply via email to