BUGFIX: Remove SDO configurations when leaving OPERATION mode.
authorFlorian Pose <fp@igh-essen.com>
Fri, 27 Oct 2006 15:04:12 +0000
changeset 465 3779b60a7c9b
parent 464 6c21a8d8c785
child 466 5f3758fdc3b5
BUGFIX: Remove SDO configurations when leaving OPERATION mode.
master/slave.c
--- a/master/slave.c	Fri Oct 27 15:01:32 2006 +0000
+++ b/master/slave.c	Fri Oct 27 15:04:12 2006 +0000
@@ -283,7 +283,17 @@
 
 void ec_slave_reset(ec_slave_t *slave /**< EtherCAT slave */)
 {
+    ec_sdo_data_t *sdodata, *next_sdodata;
+
+    // remove FMMU configurations
     slave->fmmu_count = 0;
+
+    // free all SDO configurations
+    list_for_each_entry_safe(sdodata, next_sdodata, &slave->sdo_confs, list) {
+        list_del(&sdodata->list);
+        kfree(sdodata->data);
+        kfree(sdodata);
+    }
 }
 
 /*****************************************************************************/