]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
hwmon: (amd_energy) modify the visibility of the counters
authorNaveen Krishna Chatradhi <nchatrad@amd.com>
Thu, 12 Nov 2020 17:21:59 +0000 (22:51 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 18 Nov 2020 18:22:28 +0000 (19:22 +0100)
commit 60268b0e8258fdea9a3c9f4b51e161c123571db3 upstream.

This patch limits the visibility to owner and groups only for the
energy counters exposed through the hwmon based amd_energy driver.

Cc: stable@vger.kernel.org
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Naveen Krishna Chatradhi <nchatrad@amd.com>
Link: https://lore.kernel.org/r/20201112172159.8781-1-nchatrad@amd.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/hwmon/amd_energy.c

index 29603742c858333c9995cef0a5789bd68ce42c8c..0dee535e6c8515f7508c90d6f2090d0c486212f3 100644 (file)
@@ -209,7 +209,7 @@ static umode_t amd_energy_is_visible(const void *_data,
                                     enum hwmon_sensor_types type,
                                     u32 attr, int channel)
 {
-       return 0444;
+       return 0440;
 }
 
 static int energy_accumulator(void *p)