From: Akinobu Mita <akinobu.mita@gmail.com>
To: linux-kernel@vger.kernel.org
Cc: Christoph Lameter <clameter@sgi.com>,
Andrew Morton <akpm@linux-foundation.org>
Subject: [PATCH -mm] module: fix __find_symbl() error checks
Date: Wed, 6 Feb 2008 22:10:26 +0900 [thread overview]
Message-ID: <20080206131024.GA5057@APFDCB5C> (raw)
The patch:
http://www.kernel.org/pub/linux/kernel/people/akpm/patches/2.6/2.6.24/2.6.24-mm1/broken-out/modules-handle-symbols-that-have-a-zero-value.patch
changes the return value of __find_symbol() so that it can handle symbols
that are zero and now it returns -errno for failure.
But some __find_symbl() error checks remain unchanged.
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Cc: Christoph Lameter <clameter@sgi.com>
---
kernel/module.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
Index: 2.6.24-mm1/kernel/module.c
===================================================================
--- 2.6.24-mm1.orig/kernel/module.c
+++ 2.6.24-mm1/kernel/module.c
@@ -977,7 +977,7 @@ static unsigned long resolve_symbol(Elf_
ret = __find_symbol(name, &owner, &crc,
!(mod->taints & TAINT_PROPRIETARY_MODULE));
- if (ret) {
+ if (!IS_ERR_VALUE(ret)) {
/* use_module can fail due to OOM,
or module initialization or unloading */
if (!check_version(sechdrs, versindex, name, mod, crc) ||
@@ -1370,7 +1370,9 @@ void *__symbol_get(const char *symbol)
preempt_disable();
value = __find_symbol(symbol, &owner, &crc, 1);
- if (value && strong_try_module_get(owner) != 0)
+ if (IS_ERR_VALUE(value))
+ value = 0;
+ else if (strong_try_module_get(owner))
value = 0;
preempt_enable();
reply other threads:[~2008-02-06 13:17 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20080206131024.GA5057@APFDCB5C \
--to=akinobu.mita@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=clameter@sgi.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.