summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSebastian Andrzej Siewior <bigeasy@linutronix.de>2012-08-30 19:26:22 +0200
committerAnton Arapov <anton@redhat.com>2012-10-29 11:23:38 +0100
commitad4adee6c3ad69df8ee28e362089545ae154b3f3 (patch)
tree0b0f28797ba5e3c3dec168235663348b7a54d61f
parent4d6ee32371c4b0123d445210ed50f52ced14f996 (diff)
downloadkernel-uprobes-ad4adee6c3ad69df8ee28e362089545ae154b3f3.zip
kernel-uprobes-ad4adee6c3ad69df8ee28e362089545ae154b3f3.tar.gz
kernel-uprobes-ad4adee6c3ad69df8ee28e362089545ae154b3f3.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>
-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 1666632..336f069 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;
}