diff --git a/kernel/gcov/fs.c b/kernel/gcov/fs.c index e892ad9ea06509ed15b11734a39885ac3a19b700..15ff01a7637912776f16f534e64d9e3f0d002afe 100644 --- a/kernel/gcov/fs.c +++ b/kernel/gcov/fs.c @@ -365,7 +365,7 @@ static const char *deskew(const char *basename) */ static void add_links(struct gcov_node *node, struct dentry *parent) { - char *basename; + const char *basename; char *target; int num; int i; @@ -381,10 +381,9 @@ static void add_links(struct gcov_node *node, struct dentry *parent) &gcov_link[i]); if (!target) goto out_err; - basename = strrchr(target, '/'); - if (!basename) + basename = kbasename(target); + if (basename == target) goto out_err; - basename++; node->links[i] = debugfs_create_symlink(deskew(basename), parent, target); if (!node->links[i])