f2fs: Fix uninitialized return in f2fs_ioc_shutdown()
authorDan Carpenter <dan.carpenter@oracle.com>
Wed, 20 Jun 2018 10:39:53 +0000 (13:39 +0300)
committerJaegeuk Kim <jaegeuk@kernel.org>
Wed, 5 Sep 2018 22:08:29 +0000 (15:08 -0700)
"ret" can be uninitialized on the success path when "in ==
F2FS_GOING_DOWN_FULLSYNC".

Fixes: 60b2b4ee2bc0 ("f2fs: Fix deadlock in shutdown ioctl")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
fs/f2fs/file.c

index 4dab0fd828257b5290d5eca25f5ece54b80392a2..2081a17f7ff42f4a1e4ec34fc293ff8e508409cf 100644 (file)
@@ -1866,7 +1866,7 @@ static int f2fs_ioc_shutdown(struct file *filp, unsigned long arg)
        struct f2fs_sb_info *sbi = F2FS_I_SB(inode);
        struct super_block *sb = sbi->sb;
        __u32 in;
-       int ret;
+       int ret = 0;
 
        if (!capable(CAP_SYS_ADMIN))
                return -EPERM;