From 20914ec48a0bdce899c7a97a8ba720110a0ee9c5 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Ignacy=20Gaw=C3=84=C2=99dzki?= Date: Tue, 17 Feb 2015 20:15:20 +0100 Subject: [PATCH] ematch: Fix auto-loading of ematch modules. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit [ Upstream commit 34eea79e2664b314cab6a30fc582fdfa7a1bb1df ] In tcf_em_validate(), after calling request_module() to load the kind-specific module, set em->ops to NULL before returning -EAGAIN, so that module_put() is not called again by tcf_em_tree_destroy(). Signed-off-by: Ignacy Gawędzki Acked-by: Cong Wang Signed-off-by: David S. Miller Signed-off-by: Ben Hutchings (cherry picked from commit 9405be73262273a6904688fb2f1e60a13117cf1b) Signed-off-by: Willy Tarreau --- net/sched/ematch.c | 1 + 1 file changed, 1 insertion(+) diff --git a/net/sched/ematch.c b/net/sched/ematch.c index aab59409728b..3dff06f2b6bd 100644 --- a/net/sched/ematch.c +++ b/net/sched/ematch.c @@ -222,6 +222,7 @@ static int tcf_em_validate(struct tcf_proto *tp, * perform the module load. Tell the caller * to replay the request. */ module_put(em->ops->owner); + em->ops = NULL; err = -EAGAIN; } #endif -- 2.43.0