ematch: Fix auto-loading of ematch modules.
authorIgnacy Gawędzki <ignacy.gawedzki@green-communications.fr>
Tue, 17 Feb 2015 19:15:20 +0000 (20:15 +0100)
committerDanny Wood <danwood76@gmail.com>
Tue, 29 Jan 2019 13:07:00 +0000 (13:07 +0000)
[ 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 <ignacy.gawedzki@green-communications.fr>
Acked-by: Cong Wang <cwang@twopensource.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/sched/ematch.c

index 3a633debb6df00f4bf13f51bacbdad0829ad321b..a2abc449ce8feb2b5a0277c79233c3f4f85e7e5d 100644 (file)
@@ -227,6 +227,7 @@ static int tcf_em_validate(struct tcf_proto *tp,
                                 * to replay the request.
                                 */
                                module_put(em->ops->owner);
+                               em->ops = NULL;
                                err = -EAGAIN;
                        }
 #endif