]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
hwmon: Use sysfs_emit in show function callbacks
authorKari Argillander <kari.argillander@gmail.com>
Fri, 19 Dec 2025 15:48:15 +0000 (17:48 +0200)
committerGuenter Roeck <linux@roeck-us.net>
Sat, 31 Jan 2026 15:38:31 +0000 (07:38 -0800)
commit141d3002521609991bc016c79ed05f10a0189e8d
tree157cef126ff59a72f902bc7ee6cbb906256a7e51
parentaa8126b914a767ccacaad53596193d4b97abcd58
hwmon: Use sysfs_emit in show function callbacks

Use sysfs_emit() over sprintf() to prevent potential overflows. In
hwmon_attr_show() that is totally impossible but looking other places
many still use sysfs_emit().

Also according Documentation/filesystems/sysfs.rst code should use
sysfs_emit().

Signed-off-by: Kari Argillander <kari.argillander@gmail.com>
Link: https://lore.kernel.org/r/20251219-hwmon-fixes-v1-2-21b29097ea3b@gmail.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
drivers/hwmon/hwmon.c