Make sure destroy function was defined before trying to call it.
authorJustin Pettit <jpettit@nicira.com>
Tue, 20 May 2008 19:43:19 +0000 (12:43 -0700)
committerJustin Pettit <jpettit@nicira.com>
Tue, 20 May 2008 19:43:19 +0000 (12:43 -0700)
datapath/chain.c

index 2b1178b..c857e9a 100644 (file)
@@ -153,7 +153,8 @@ void chain_destroy(struct sw_chain *chain)
        synchronize_rcu();
        for (i = 0; i < chain->n_tables; i++) {
                struct sw_table *t = chain->tables[i];
-               t->destroy(t);
+               if (t->destroy)
+                       t->destroy(t);
        }
        module_put(chain->owner);
        kfree(chain);