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>
This commit is contained in:
Sebastian Andrzej Siewior 2012-08-30 19:26:22 +02:00 committed by Oleg Nesterov
parent ded86e7c8f
commit 6d1d8dfa8b

View File

@ -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;
}