No need to duplicate the destroy code executed by the state
machine, just set the current port's next action to DESTROY
and then execute that state.

Signed-off-by: Robert Love <robert.w.l...@intel.com>
---
 fcoemon.c |   11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/fcoemon.c b/fcoemon.c
index 491d68a..91a67f2 100644
--- a/fcoemon.c
+++ b/fcoemon.c
@@ -1795,11 +1795,16 @@ static void fcm_cleanup(void)
 
        for (curr = fcoe_config.port; curr; curr = next) {
                FCM_LOG_DBG("OP: DESTROY %s\n", curr->ifname);
-               fcm_fcoe_if_action(FCOE_DESTROY,  curr->ifname);
-               next = curr->next;
-               free(curr);
+
+               ff = fcm_netif_lookup(curr->ifname);
+               if (!ff) {
+                       fcp_set_next_action(curr, FCP_DESTROY_IF);
+                       fcm_fcoe_action(ff, curr);
+               }
        }
 
+       ff = NULL;
+
        for (head = TAILQ_FIRST(&fcm_netif_head); head; head = ff) {
                ff = TAILQ_NEXT(head, ff_list);
                TAILQ_REMOVE(&fcm_netif_head, head, ff_list);

_______________________________________________
devel mailing list
devel@open-fcoe.org
https://lists.open-fcoe.org/mailman/listinfo/devel

Reply via email to