From: Colin King <colin.king@canonical.com>
To: Miklos Szeredi <miklos@szeredi.hu>, linux-fsdevel@vger.kernel.org
Cc: kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH][next] fuse: Fix uninitiailized error return in variable err
Date: Fri, 6 Aug 2021 10:50:27 +0100 [thread overview]
Message-ID: <20210806095027.8408-1-colin.king@canonical.com> (raw)
From: Colin Ian King <colin.king@canonical.com>
There is an error return path where err is being returned but
it not been yet set. Fix this by just returning -EINVAL.
Addresses-Coverity: ("Uninitialized scalar variable")
Fixes: ff12b2314569 ("fuse: move fget() to fuse_get_tree()")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
fs/fuse/inode.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/fuse/inode.c b/fs/fuse/inode.c
index 0580a8319593..09adb4f4734e 100644
--- a/fs/fuse/inode.c
+++ b/fs/fuse/inode.c
@@ -1522,7 +1522,7 @@ static int fuse_fill_super(struct super_block *sb, struct fs_context *fsc)
*/
if ((ctx->file->f_op != &fuse_dev_operations) ||
(ctx->file->f_cred->user_ns != sb->s_user_ns))
- goto err;
+ return -EINVAL;
ctx->fudptr = &ctx->file->private_data;
fc = kmalloc(sizeof(*fc), GFP_KERNEL);
--
2.31.1
reply other threads:[~2021-08-06 9:50 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20210806095027.8408-1-colin.king@canonical.com \
--to=colin.king@canonical.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=miklos@szeredi.hu \
/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: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).