diff options
author | Jiri Kosina <jkosina@suse.cz> | 2008-06-26 12:03:08 +0200 |
---|---|---|
committer | Stephen Rothwell <sfr@canb.auug.org.au> | 2008-06-27 00:13:26 +1000 |
commit | 9af4b650d197c3b2db2a6b8134d1c9588f888179 (patch) | |
tree | aab93e70f2f6c771a14ecd00df0a46949c9c75d3 | |
parent | c74a8816c2b385f80249ae76c863bf4017b38491 (diff) |
module: fix NULL pointer dereference in find_symbol()
The patch that introduces each_symbol() iterator forgets to
test the NULL value of the output parameters (which the original
code did).
This patch restores the correct checks.
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Tested-by: "Rafael J. Wysocki" <rjw@sisk.pl>
-rw-r--r-- | kernel/module.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/kernel/module.c b/kernel/module.c index ceae92b68a45..c12311c803c4 100644 --- a/kernel/module.c +++ b/kernel/module.c @@ -312,8 +312,10 @@ static unsigned long find_symbol(const char *name, fsa.warn = warn; if (each_symbol(find_symbol_in_section, &fsa)) { - *owner = fsa.owner; - *crc = fsa.crc; + if (owner) + *owner = fsa.owner; + if (crc) + *crc = fsa.crc; return fsa.value; } |