From: Hendrik Brueckner Date: Tue, 8 Jun 2010 16:58:10 +0000 (+0200) Subject: [S390] kprobes: add parameter check to module_free() X-Git-Tag: v2.6.35-rc3~24^2~2 X-Git-Url: https://openfabrics.org/gitweb/?a=commitdiff_plain;h=3164a3cbf8a6bdf85fe3816fe670b391f31c004a;p=~emulex%2Finfiniband.git [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 Signed-off-by: Martin Schwidefsky --- diff --git a/arch/s390/kernel/module.c b/arch/s390/kernel/module.c index 639380a0c45..22cfd634c35 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); }