浏览代码

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>
Ignacy Gawędzki 10 年之前
父节点
当前提交
34eea79e26
共有 1 个文件被更改,包括 1 次插入0 次删除
  1. 1 0
      net/sched/ematch.c

+ 1 - 0
net/sched/ematch.c

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