Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ematch: Fix auto-loading of ematch modules.

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>

authored by

Ignacy Gawędzki and committed by
David S. Miller
34eea79e 54da5a8b

+1
+1
net/sched/ematch.c
··· 228 228 * to replay the request. 229 229 */ 230 230 module_put(em->ops->owner); 231 + em->ops = NULL; 231 232 err = -EAGAIN; 232 233 } 233 234 #endif