mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: rmingming <mingming.nk@gmail.com>
To: linux-kernel@vger.kernel.org
Subject: Is try_module_get buggy?
Date: Sat, 12 Jan 2008 12:35:27 +0800	[thread overview]
Message-ID: <4cc25cb20801112035x16c69a40rf3103a73b6cda107@mail.gmail.com> (raw)

Hi,
 I have a problem about the try_module_get function, I don't know if someone
removed the module just AFTER line 372, then what happens? Because in this
situation, the variable module will be incorrect, and module_is_live
function will lead to unpredicatable behaviour.

368 static inline int try_module_get(struct module *module)
369 {
370         int ret = 1;
371
372         if (module) {
373                 unsigned int cpu = get_cpu();
374                 if (likely(module_is_live(module)))
375                         local_inc(&module->ref[cpu].count);
376                 else
377                         ret = 0;
378                 put_cpu();
379         }
380         return ret;
381 }

Best wishes to all,
rmingming

             reply	other threads:[~2008-01-12  4:35 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-01-12  4:35 rmingming [this message]
2008-01-17  3:09 ` Rusty Russell
2008-01-23 14:34   ` rmingming

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=4cc25cb20801112035x16c69a40rf3103a73b6cda107@mail.gmail.com \
    --to=mingming.nk@gmail.com \
    --cc=linux-kernel@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

all inboxes | Powered by JetHome®