dect
/
linux-2.6
Archived
13
0
Fork 0

trace: use kbasename()

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
Andy Shevchenko 2012-12-17 16:01:27 -08:00 committed by Linus Torvalds
parent f9a00e8738
commit b2e902f024
1 changed files with 4 additions and 4 deletions

View File

@ -22,6 +22,7 @@
#include <linux/uaccess.h>
#include <linux/uprobes.h>
#include <linux/namei.h>
#include <linux/string.h>
#include "trace_probe.h"
@ -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';