diff options
author | Hendrik Brueckner <brueckner@linux.vnet.ibm.com> | 2010-06-08 12:58:10 -0400 |
---|---|---|
committer | Martin Schwidefsky <sky@mschwide.boeblingen.de.ibm.com> | 2010-06-08 12:58:23 -0400 |
commit | 3164a3cbf8a6bdf85fe3816fe670b391f31c004a (patch) | |
tree | 97049722a425f249e04d24d7a964328b8deaeea6 /arch | |
parent | c2f0e8c803ceba530060ec9bb9c74a06c2c3d833 (diff) |
[S390] kprobes: add parameter check to module_free()
When unregistering kprobes, kprobes calls module_free() and
always passes NULL for the mod parameter. Add a check to
prevent NULL pointer dereferences.
See commit 740a8de0796dd12890b3c8ddcfabfcb528b78d40 for more details.
Signed-off-by: Hendrik Brueckner <brueckner@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/s390/kernel/module.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/arch/s390/kernel/module.c b/arch/s390/kernel/module.c index 639380a0c45c..22cfd634c355 100644 --- a/arch/s390/kernel/module.c +++ b/arch/s390/kernel/module.c | |||
@@ -55,8 +55,10 @@ void *module_alloc(unsigned long size) | |||
55 | /* Free memory returned from module_alloc */ | 55 | /* Free memory returned from module_alloc */ |
56 | void module_free(struct module *mod, void *module_region) | 56 | void module_free(struct module *mod, void *module_region) |
57 | { | 57 | { |
58 | vfree(mod->arch.syminfo); | 58 | if (mod) { |
59 | mod->arch.syminfo = NULL; | 59 | vfree(mod->arch.syminfo); |
60 | mod->arch.syminfo = NULL; | ||
61 | } | ||
60 | vfree(module_region); | 62 | vfree(module_region); |
61 | } | 63 | } |
62 | 64 | ||