From: Felix Fietkau <nbd@nbd.name>
Date: Sun, 25 Feb 2018 15:23:07 +0000 (+0100)
Subject: kernel: fix crash in flow offload code when cleaning up unregistered hooks
X-Git-Url: http://git.cdn.openwrt.org/?a=commitdiff_plain;h=1ac14d312fc8042ab75abcac4decdb47a77c05f0;p=openwrt%2Fstaging%2Fnbd.git

kernel: fix crash in flow offload code when cleaning up unregistered hooks

Signed-off-by: Felix Fietkau <nbd@nbd.name>
---

diff --git a/target/linux/generic/hack-4.14/650-netfilter-add-xt_OFFLOAD-target.patch b/target/linux/generic/hack-4.14/650-netfilter-add-xt_OFFLOAD-target.patch
index e2279fce65..40f89d4d91 100644
--- a/target/linux/generic/hack-4.14/650-netfilter-add-xt_OFFLOAD-target.patch
+++ b/target/linux/generic/hack-4.14/650-netfilter-add-xt_OFFLOAD-target.patch
@@ -216,7 +216,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
 +
 +restart:
 +	hlist_for_each_entry(hook, &hooks, list) {
-+		if (hook->used)
++		if (hook->used || !hook->registered)
 +			continue;
 +
 +		hlist_del(&hook->list);