]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
resctrl: get rid of pointless debugfs_file_{get,put}()
authorAl Viro <viro@zeniv.linux.org.uk>
Wed, 2 Jul 2025 21:16:50 +0000 (22:16 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 9 Jul 2025 11:30:28 +0000 (13:30 +0200)
->write() of file_operations that gets used only via debugfs_create_file()
is called only under debugfs_file_get()

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Acked-by: Reinette Chatre <reinette.chatre@intel.com>
Link: https://lore.kernel.org/r/20250702211650.GD3406663@ZenIV
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/resctrl/pseudo_lock.c

index ccc2f9213b4b6b5d70ef89393d6268456996fa15..87bbc2605de12d661556c13ebe48c37d3338ed1c 100644 (file)
@@ -764,13 +764,9 @@ static ssize_t pseudo_lock_measure_trigger(struct file *file,
        if (ret == 0) {
                if (sel != 1 && sel != 2 && sel != 3)
                        return -EINVAL;
-               ret = debugfs_file_get(file->f_path.dentry);
-               if (ret)
-                       return ret;
                ret = pseudo_lock_measure_cycles(rdtgrp, sel);
                if (ret == 0)
                        ret = count;
-               debugfs_file_put(file->f_path.dentry);
        }
 
        return ret;