summaryrefslogtreecommitdiff
path: root/init/initramfs.c
diff options
context:
space:
mode:
authorBarret Rhoden <brho@google.com>2020-09-04 16:53:32 +0300
committerLinus Torvalds <torvalds@linux-foundation.org>2020-09-04 19:16:58 +0300
commit7b81ce7cdcef3a3ae71eb3fb863433c646b4a2f4 (patch)
treef9881dae5e1b7b38bc06f5cec665f6ff34868cf4 /init/initramfs.c
parent59126901f200f5fc907153468b03c64e0081b6e6 (diff)
downloadlinux-7b81ce7cdcef3a3ae71eb3fb863433c646b4a2f4.tar.xz
init: fix error check in clean_path()
init_stat() returns 0 on success, same as vfs_lstat(). When it replaced vfs_lstat(), the '!' was dropped. Fixes: 716308a5331b ("init: add an init_stat helper") Signed-off-by: Barret Rhoden <brho@google.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'init/initramfs.c')
-rw-r--r--init/initramfs.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/init/initramfs.c b/init/initramfs.c
index e6dbfb767057..1f97c0328a7a 100644
--- a/init/initramfs.c
+++ b/init/initramfs.c
@@ -297,7 +297,7 @@ static void __init clean_path(char *path, umode_t fmode)
{
struct kstat st;
- if (init_stat(path, &st, AT_SYMLINK_NOFOLLOW) &&
+ if (!init_stat(path, &st, AT_SYMLINK_NOFOLLOW) &&
(st.mode ^ fmode) & S_IFMT) {
if (S_ISDIR(st.mode))
init_rmdir(path);