summaryrefslogtreecommitdiff
path: root/kernel/events
diff options
context:
space:
mode:
authorSebastian Andrzej Siewior <bigeasy@linutronix.de>2012-08-30 21:26:22 +0400
committerOleg Nesterov <oleg@redhat.com>2012-09-15 19:34:05 +0400
commit6d1d8dfa8b65831cfa9a528e3d17efa7e7f4226c (patch)
tree2e13b65228f1c879bee978acc35ec7f6755f7ba5 /kernel/events
parentded86e7c8fc4404414c4700010c9962ea8bd083a (diff)
downloadlinux-6d1d8dfa8b65831cfa9a528e3d17efa7e7f4226c.tar.xz
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 <bigeasy@linutronix.de> Signed-off-by: Oleg Nesterov <oleg@redhat.com> Acked-by: Srikar Dronamraju <srikar@linux.vnet.ibm.com>
Diffstat (limited to 'kernel/events')
-rw-r--r--kernel/events/uprobes.c3
1 files changed, 2 insertions, 1 deletions
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;
}