]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
cachefiles: Fix double fput
authorDavid Howells <dhowells@redhat.com>
Thu, 25 Jun 2026 14:06:21 +0000 (15:06 +0100)
committerChristian Brauner <brauner@kernel.org>
Wed, 1 Jul 2026 13:26:28 +0000 (15:26 +0200)
Fix a double fput() in error handling in cachefiles_create_tmpfile().

Link: https://sashiko.dev/#/patchset/20260608145432.681865-1-dhowells%40redhat.com
Signed-off-by: David Howells <dhowells@redhat.com>
Link: https://patch.msgid.link/20260625140640.3116900-4-dhowells@redhat.com
cc: Paulo Alcantara <pc@manguebit.org>
cc: netfs@lists.linux.dev
cc: linux-fsdevel@vger.kernel.org
Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
fs/cachefiles/namei.c

index 2c46f0decb02e438392d69df348f030612b45ab6..67793898148b9ddc317fd53487c3c972cea4d4e5 100644 (file)
@@ -466,7 +466,6 @@ struct file *cachefiles_create_tmpfile(struct cachefiles_object *object)
        ret = -EINVAL;
        if (unlikely(!file->f_op->read_iter) ||
            unlikely(!file->f_op->write_iter)) {
-               fput(file);
                pr_notice("Cache does not support read_iter and write_iter\n");
                goto err_unuse;
        }