Commit 3164a3cb authored by Hendrik Brueckner's avatar Hendrik Brueckner Committed by Martin Schwidefsky

[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 740a8de0 for more details.
Signed-off-by: default avatarHendrik Brueckner <brueckner@linux.vnet.ibm.com>
Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
parent c2f0e8c8
...@@ -55,8 +55,10 @@ void *module_alloc(unsigned long size) ...@@ -55,8 +55,10 @@ void *module_alloc(unsigned long size)
/* Free memory returned from module_alloc */ /* Free memory returned from module_alloc */
void module_free(struct module *mod, void *module_region) void module_free(struct module *mod, void *module_region)
{ {
if (mod) {
vfree(mod->arch.syminfo); vfree(mod->arch.syminfo);
mod->arch.syminfo = NULL; mod->arch.syminfo = NULL;
}
vfree(module_region); vfree(module_region);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment