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:42:37 +0100
commitd602a6d65af71f423c46bcecd947bb82ab2f97b7 (patch)
tree41fc0df235b57bb9bcc04e4ab95ce2621804b224
parent191c64ab775ea20a77f63a97b3b2d1208d60fd52 (diff)
downloadkernel-uprobes-d602a6d65af71f423c46bcecd947bb82ab2f97b7.zip
kernel-uprobes-d602a6d65af71f423c46bcecd947bb82ab2f97b7.tar.gz
kernel-uprobes-d602a6d65af71f423c46bcecd947bb82ab2f97b7.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;
}