From: Sebastian Andrzej Siewior Date: Thu, 30 Aug 2012 17:26:22 +0000 (+0200) Subject: uprobes: Don't put NULL pointer in uprobe_register() X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=6d1d8dfa8b65831cfa9a528e3d17efa7e7f4226c;p=GitHub%2Fexynos8895%2Fandroid_kernel_samsung_universal8895.git uprobes: Don't put NULL pointer in uprobe_register() alloc_uprobe() might return a NULL pointer, put_uprobe() can't deal with this. Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: Oleg Nesterov Acked-by: Srikar Dronamraju --- diff --git a/kernel/events/uprobes.c b/kernel/events/uprobes.c index 1666632e6edf..336f06948de1 100644 --- a/kernel/events/uprobes.c +++ b/kernel/events/uprobes.c @@ -897,7 +897,8 @@ int uprobe_register(struct inode *inode, loff_t offset, struct uprobe_consumer * } mutex_unlock(uprobes_hash(inode)); - put_uprobe(uprobe); + if (uprobe) + put_uprobe(uprobe); return ret; }