cachefiles: Fix double fput

JIRA: https://issues.redhat.com/browse/RHEL-190706

commit af6830cc12dfe86c832dccc9c9878a93aaa22f83
Author: David Howells <dhowells@redhat.com>
Date:   Thu Jun 25 15:06:21 2026 +0100

    cachefiles: Fix double fput

    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>

Signed-off-by: Paulo Alcantara <paalcant@redhat.com>
This commit is contained in:
Paulo Alcantara
2026-07-20 20:30:10 -03:00
parent fd110d8e87
commit edec0deafd
-1
View File
@@ -497,7 +497,6 @@ struct file *cachefiles_create_tmpfile(struct cachefiles_object *object)
ret = -EINVAL; ret = -EINVAL;
if (unlikely(!file->f_op->read_iter) || if (unlikely(!file->f_op->read_iter) ||
unlikely(!file->f_op->write_iter)) { unlikely(!file->f_op->write_iter)) {
fput(file);
pr_notice("Cache does not support read_iter and write_iter\n"); pr_notice("Cache does not support read_iter and write_iter\n");
goto err_unuse; goto err_unuse;
} }