]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
fuse: drop redundant err assignment in fuse_create_open()
authorLi Wang <liwang@kylinos.cn>
Fri, 10 Apr 2026 02:34:33 +0000 (10:34 +0800)
committerMiklos Szeredi <mszeredi@redhat.com>
Mon, 15 Jun 2026 12:06:18 +0000 (14:06 +0200)
In fuse_create_open(), err is initialized to -ENOMEM immediately before
the fuse_alloc_forget() NULL check. If forget allocation fails,
it branches to out_err with that value. If it succeeds, it falls through
without modifying err, so err is still -ENOMEM at the point where
fuse_file_alloc() is called. The second err = -ENOMEM before
fuse_file_alloc() therefore is redundant.

Signed-off-by: Li Wang <liwang@kylinos.cn>
Reviewed-by: Joanne Koong <joannelkoong@gmail.com>
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
fs/fuse/dir.c

index 0ceb49337a4426d6f8a32e91f0014b213a15bee5..2872e068c31784179164ecf136bf9a693c9fc11a 100644 (file)
@@ -838,7 +838,6 @@ static int fuse_create_open(struct mnt_idmap *idmap, struct inode *dir,
        if (!forget)
                goto out_err;
 
-       err = -ENOMEM;
        ff = fuse_file_alloc(fm, true);
        if (!ff)
                goto out_put_forget_req;