Skip to content

Commit d4ffeab

Browse files
author
Al Viro
committed
do_readlinkat(): switch to CLASS(filename_flags)
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
1 parent 97ed55d commit d4ffeab

1 file changed

Lines changed: 2 additions & 6 deletions

File tree

fs/stat.c

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -564,20 +564,17 @@ static int do_readlinkat(int dfd, const char __user *pathname,
564564
char __user *buf, int bufsiz)
565565
{
566566
struct path path;
567-
struct filename *name;
568567
int error;
569568
unsigned int lookup_flags = 0;
570569

571570
if (bufsiz <= 0)
572571
return -EINVAL;
573572

574-
name = getname_flags(pathname, LOOKUP_EMPTY);
573+
CLASS(filename_flags, name)(pathname, LOOKUP_EMPTY);
575574
retry:
576575
error = filename_lookup(dfd, name, lookup_flags, &path, NULL);
577-
if (unlikely(error)) {
578-
putname(name);
576+
if (unlikely(error))
579577
return error;
580-
}
581578

582579
/*
583580
* AFS mountpoints allow readlink(2) but are not symlinks
@@ -597,7 +594,6 @@ static int do_readlinkat(int dfd, const char __user *pathname,
597594
lookup_flags |= LOOKUP_REVAL;
598595
goto retry;
599596
}
600-
putname(name);
601597
return error;
602598
}
603599

0 commit comments

Comments
 (0)