[PATCH 3.16.y-ckt 017/165] ematch: Fix auto-loading of ematch modules.

Luis Henriques luis.henriques at canonical.com
Wed Mar 25 13:59:50 UTC 2015

3.16.7-ckt9 -stable review patch.  If anyone has any objections, please let me know.


From: =?UTF-8?q?Ignacy=20Gaw=C4=99dzki?=

commit 34eea79e2664b314cab6a30fc582fdfa7a1bb1df upstream.

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 at green-communications.fr>
Acked-by: Cong Wang <cwang at twopensource.com>
Signed-off-by: David S. Miller <davem at davemloft.net>
Signed-off-by: Luis Henriques <luis.henriques at canonical.com>
 net/sched/ematch.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/net/sched/ematch.c b/net/sched/ematch.c
index 3a633debb6df..a2abc449ce8f 100644
--- a/net/sched/ematch.c
+++ b/net/sched/ematch.c
@@ -227,6 +227,7 @@ static int tcf_em_validate(struct tcf_proto *tp,
 				 * to replay the request.
+				em->ops = NULL;
 				err = -EAGAIN;

More information about the kernel-team mailing list