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

Author: Alexis Berlemont <alexis.berlem...@gmail.com>
Date:   Sun Sep 20 23:42:46 2009 +0200

Initialize the freshly allocated device's private area

---

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

diff --git a/ksrc/drivers/comedi/device.c b/ksrc/drivers/comedi/device.c
index 30b790f..3d621d5 100644
--- a/ksrc/drivers/comedi/device.c
+++ b/ksrc/drivers/comedi/device.c
@@ -315,6 +315,11 @@ int comedi_assign_driver(comedi_cxt_t * cxt,
                        ret = -ENOMEM;
                        goto out_assign_driver;
                }
+
+               /* Initialize the private data even if it not our role
+                  (the driver should do it), that may prevent hard to
+                  find bugs */
+               memset(dev->priv, 0, drv->prvdata_size);
        }
 
        if ((ret = drv->attach(dev, link_arg)) != 0)


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

Reply via email to