[PATCH 3.13.y-ckt 058/156] ematch: Fix auto-loading of ematch modules.

From: Kamal Mostafa
Date: Tue Apr 07 2015 - 19:24:36 EST

3.13.11-ckt19 -stable review patch. If anyone has any objections, please let me know.


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

[ 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@xxxxxxxxxxxxxxxxxxxxxxx>
Acked-by: Cong Wang <cwang@xxxxxxxxxxxxxxxx>
Signed-off-by: David S. Miller <davem@xxxxxxxxxxxxx>
Signed-off-by: Kamal Mostafa <kamal@xxxxxxxxxxxxx>
net/sched/ematch.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/net/sched/ematch.c b/net/sched/ematch.c
index 3a633de..a2abc44 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;

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/