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

Author: Jorge Ramirez-Ortiz <j...@xenomai.org>
Date:   Wed Mar 11 18:51:29 2015 -0400

drivers/analogy: fix detach logic

Clearing the transfer data before detaching the device will delete
the structure holding the interrupt data before having freed the
interrupt line.

---

 ksrc/drivers/analogy/device.c |   10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/ksrc/drivers/analogy/device.c b/ksrc/drivers/analogy/device.c
index 843efdc..84b7f7b 100644
--- a/ksrc/drivers/analogy/device.c
+++ b/ksrc/drivers/analogy/device.c
@@ -405,15 +405,19 @@ int a4l_ioctl_devcfg(a4l_cxt_t * cxt, void *arg)
                   that nothing is busy */
                if ((ret = a4l_precleanup_transfer(cxt)) != 0)
                        return ret;
+
                /* Remove the related proc file */
                a4l_proc_detach(cxt);
-               /* Free the transfer structure and its related data */
-               if ((ret = a4l_cleanup_transfer(cxt)) != 0)
-                       return ret;
+
                /* Free the device and the driver from each other */
                if ((ret = a4l_device_detach(cxt)) == 0)
                        clear_bit(A4L_DEV_ATTACHED_NR,
                                  &(a4l_get_dev(cxt)->flags));
+
+               /* Free the transfer structure and its related data */
+               if ((ret = a4l_cleanup_transfer(cxt)) != 0)
+                       return ret;
+
        } else {
                /* Basic checking */
                if (test_bit


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

Reply via email to