From: Ignacy Gawędzki Date: Tue, 17 Feb 2015 19:15:20 +0000 (+0100) Subject: ematch: Fix auto-loading of ematch modules. X-Git-Tag: v3.10.72~55 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cae79d75dd639bca743b91d5532a09d90bc3492d;p=thirdparty%2Fkernel%2Fstable.git ematch: Fix auto-loading of ematch modules. [ 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: Greg Kroah-Hartman --- diff --git a/net/sched/ematch.c b/net/sched/ematch.c index 3a633debb6df0..a2abc449ce8fe 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. */ module_put(em->ops->owner); + em->ops = NULL; err = -EAGAIN; } #endif