uprobes: Don't put NULL pointer in uprobe_register()
authorSebastian Andrzej Siewior <bigeasy@linutronix.de>
Thu, 30 Aug 2012 17:26:22 +0000 (19:26 +0200)
committerOleg Nesterov <oleg@redhat.com>
Sat, 15 Sep 2012 15:34:05 +0000 (17:34 +0200)
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>
kernel/events/uprobes.c

index 1666632e6edfcfc07c867c91d5b7039dc84ce2f6..336f06948de136c355c321ad09b91e1533f3ed8b 100644 (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;
 }