diff options
author | Hendrik Brueckner <brueckner@linux.vnet.ibm.com> | 2010-06-08 18:58:10 +0200 |
---|---|---|
committer | Martin Schwidefsky <sky@mschwide.boeblingen.de.ibm.com> | 2010-06-08 18:58:23 +0200 |
commit | 3164a3cbf8a6bdf85fe3816fe670b391f31c004a (patch) | |
tree | 97049722a425f249e04d24d7a964328b8deaeea6 /arch/s390 | |
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/s390')
-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) /* Free memory returned from module_alloc */ void module_free(struct module *mod, void *module_region) { - vfree(mod->arch.syminfo); - mod->arch.syminfo = NULL; + if (mod) { + vfree(mod->arch.syminfo); + mod->arch.syminfo = NULL; + } vfree(module_region); } |