Skip to content

Commit

Permalink
uprobes: Don't put NULL pointer in uprobe_register()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Sebastian Andrzej Siewior authored and Oleg Nesterov committed Sep 15, 2012
1 parent ded86e7 commit 6d1d8df
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion kernel/events/uprobes.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 6d1d8df

Please sign in to comment.