Skip to content

Commit 7b81ce7

Browse files
Barret Rhodentorvalds
authored andcommitted
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: 716308a ("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>
1 parent 5912690 commit 7b81ce7

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎init/initramfs.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,7 @@ static void __init clean_path(char *path, umode_t fmode)
297297
{
298298
struct kstat st;
299299

300-
if (init_stat(path, &st, AT_SYMLINK_NOFOLLOW) &&
300+
if (!init_stat(path, &st, AT_SYMLINK_NOFOLLOW) &&
301301
(st.mode ^ fmode) & S_IFMT) {
302302
if (S_ISDIR(st.mode))
303303
init_rmdir(path);

0 commit comments

Comments
 (0)