From: Wei Yongjun <weiyongjun1@huawei.com> To: <weiyongjun1@huawei.com>, Gao Xiang <xiang@kernel.org>, Chao Yu <chao@kernel.org> Cc: <linux-erofs@lists.ozlabs.org>, <linux-kernel@vger.kernel.org>, <kernel-janitors@vger.kernel.org>, Hulk Robot <hulkci@huawei.com> Subject: [PATCH -next] erofs: fix error return code in erofs_read_superblock() Date: Wed, 19 May 2021 14:16:57 +0000 [thread overview] Message-ID: <20210519141657.3062715-1-weiyongjun1@huawei.com> (raw) 'ret' will be overwritten to 0 if erofs_sb_has_sb_chksum() return true, thus 0 will return in some error handling cases. Fix to return negative error code -EINVAL instead of 0. Reported-by: Hulk Robot <hulkci@huawei.com> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com> --- fs/erofs/super.c | 1 + 1 file changed, 1 insertion(+) diff --git a/fs/erofs/super.c b/fs/erofs/super.c index bbf3bbd908e0..22991d22af5a 100644 --- a/fs/erofs/super.c +++ b/fs/erofs/super.c @@ -285,6 +285,7 @@ static int erofs_read_superblock(struct super_block *sb) goto out; } + ret = -EINVAL; blkszbits = dsb->blkszbits; /* 9(512 bytes) + LOG_SECTORS_PER_BLOCK == LOG_BLOCK_SIZE */ if (blkszbits != LOG_BLOCK_SIZE) {
WARNING: multiple messages have this Message-ID (diff)
From: Wei Yongjun <weiyongjun1@huawei.com> To: <weiyongjun1@huawei.com>, Gao Xiang <xiang@kernel.org>, Chao Yu <chao@kernel.org> Cc: kernel-janitors@vger.kernel.org, linux-erofs@lists.ozlabs.org, linux-kernel@vger.kernel.org, Hulk Robot <hulkci@huawei.com> Subject: [PATCH -next] erofs: fix error return code in erofs_read_superblock() Date: Wed, 19 May 2021 14:16:57 +0000 [thread overview] Message-ID: <20210519141657.3062715-1-weiyongjun1@huawei.com> (raw) 'ret' will be overwritten to 0 if erofs_sb_has_sb_chksum() return true, thus 0 will return in some error handling cases. Fix to return negative error code -EINVAL instead of 0. Reported-by: Hulk Robot <hulkci@huawei.com> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com> --- fs/erofs/super.c | 1 + 1 file changed, 1 insertion(+) diff --git a/fs/erofs/super.c b/fs/erofs/super.c index bbf3bbd908e0..22991d22af5a 100644 --- a/fs/erofs/super.c +++ b/fs/erofs/super.c @@ -285,6 +285,7 @@ static int erofs_read_superblock(struct super_block *sb) goto out; } + ret = -EINVAL; blkszbits = dsb->blkszbits; /* 9(512 bytes) + LOG_SECTORS_PER_BLOCK == LOG_BLOCK_SIZE */ if (blkszbits != LOG_BLOCK_SIZE) {
next reply other threads:[~2021-05-19 14:07 UTC|newest] Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top 2021-05-19 14:16 Wei Yongjun [this message] 2021-05-19 14:16 ` [PATCH -next] erofs: fix error return code in erofs_read_superblock() Wei Yongjun 2021-05-20 5:32 ` Dan Carpenter 2021-05-20 5:32 ` Dan Carpenter 2021-05-20 8:40 ` Gao Xiang 2021-05-20 8:40 ` Gao Xiang 2021-05-21 1:14 ` Chao Yu 2021-05-21 1:14 ` Chao Yu 2021-05-21 1:57 ` Gao Xiang 2021-05-21 1:57 ` Gao Xiang
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20210519141657.3062715-1-weiyongjun1@huawei.com \ --to=weiyongjun1@huawei.com \ --cc=chao@kernel.org \ --cc=hulkci@huawei.com \ --cc=kernel-janitors@vger.kernel.org \ --cc=linux-erofs@lists.ozlabs.org \ --cc=linux-kernel@vger.kernel.org \ --cc=xiang@kernel.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.