Netdev List
 help / color / mirror / Atom feed
From: "Ignacy Gawędzki" <ignacy.gawedzki@green-communications.fr>
To: netdev@vger.kernel.org
Subject: [PATCH net v2] ematch: Fix auto-loading of ematch modules.
Date: Tue, 17 Feb 2015 20:15:20 +0100	[thread overview]
Message-ID: <20150217191520.GA15405@zenon.in.qult.net> (raw)
In-Reply-To: <CAHA+R7Os10B8KuBV0K9qp48zo2+=_aXUR-k5ocXjEWYqtq222w@mail.gmail.com>

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>
---
 net/sched/ematch.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/net/sched/ematch.c b/net/sched/ematch.c
index 6742200..fbb7ebf 100644
--- a/net/sched/ematch.c
+++ b/net/sched/ematch.c
@@ -228,6 +228,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
-- 
2.1.0

  reply	other threads:[~2015-02-17 19:16 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-16 10:59 Attempt to auto-load em_cmp.ko results in negative module refcnt Ignacy Gawedzki
2015-02-16 15:03 ` Ignacy Gawedzki
2015-02-16 18:13   ` [PATCH net] ematch: Fix auto-loading of ematch modules Ignacy Gawędzki
2015-02-16 18:36     ` Cong Wang
2015-02-16 18:50       ` Ignacy Gawędzki
2015-02-17 18:00         ` Cong Wang
2015-02-17 19:15           ` Ignacy Gawędzki [this message]
2015-02-18  5:17             ` [PATCH net v2] " Cong Wang
2015-02-20 20:31             ` David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150217191520.GA15405@zenon.in.qult.net \
    --to=ignacy.gawedzki@green-communications.fr \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox