aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--net/filter.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/net/filter.c b/net/filter.c
index d2a514eb8d..7cdbc6c615 100644
--- a/net/filter.c
+++ b/net/filter.c
@@ -196,7 +196,8 @@ static void netfilter_finalize(Object *obj)
nfc->cleanup(nf);
}
- if (nf->netdev && !QTAILQ_EMPTY(&nf->netdev->filters)) {
+ if (nf->netdev && !QTAILQ_EMPTY(&nf->netdev->filters) &&
+ nf->next.tqe_prev) {
QTAILQ_REMOVE(&nf->netdev->filters, nf, next);
}
g_free(nf->netdev_id);