Fixed duplicate kfree() bug.
authorFlorian Pose <fp@igh-essen.com>
Thu, 12 Jun 2008 13:00:32 +0000
changeset 1004 990b89d8ad03
parent 1003 f7cf194d6979
child 1005 5af7ab9a98b1
Fixed duplicate kfree() bug.
master/master.c
--- a/master/master.c	Thu Jun 12 11:53:06 2008 +0000
+++ b/master/master.c	Thu Jun 12 13:00:32 2008 +0000
@@ -251,14 +251,14 @@
             slave < master->slaves + master->slave_count;
             slave++) {
         ec_slave_clear(slave);
-        kfree(slave);
-    }
-
-    if (master->slave_count) {
+    }
+
+    if (master->slaves) {
         kfree(master->slaves);
         master->slaves = NULL;
-        master->slave_count = 0;
-    }
+    }
+
+    master->slave_count = 0;
 }
 
 /*****************************************************************************/