summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJiri Kosina <jkosina@suse.cz>2008-06-26 12:03:08 +0200
committerStephen Rothwell <sfr@canb.auug.org.au>2008-07-02 00:21:36 +1000
commit83f8a5359d7111f6cfd9932321c92996db4b8d50 (patch)
tree01c65cb1ad573a899c0bf0599f2f47f1a50c0698
parent634fd5a6ba5513300e8c296f6145f15d9b53fcd4 (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.c6
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;
}