Skip to content

Commit

Permalink
trace: use kbasename()
Browse files Browse the repository at this point in the history
Signed-off-by: Andy Shevchenko <[email protected]>
Cc: Steven Rostedt <[email protected]>
Cc: Frederic Weisbecker <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
andy-shev authored and torvalds committed Dec 18, 2012
1 parent f9a00e8 commit b2e902f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions kernel/trace/trace_uprobe.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#include <linux/uaccess.h>
#include <linux/uprobes.h>
#include <linux/namei.h>
#include <linux/string.h>

#include "trace_probe.h"

Expand Down Expand Up @@ -263,16 +264,15 @@ static int create_trace_uprobe(int argc, char **argv)

/* setup a probe */
if (!event) {
char *tail = strrchr(filename, '/');
char *tail;
char *ptr;

ptr = kstrdup((tail ? tail + 1 : filename), GFP_KERNEL);
if (!ptr) {
tail = kstrdup(kbasename(filename), GFP_KERNEL);
if (!tail) {
ret = -ENOMEM;
goto fail_address_parse;
}

tail = ptr;
ptr = strpbrk(tail, ".-_");
if (ptr)
*ptr = '\0';
Expand Down

0 comments on commit b2e902f

Please sign in to comment.