]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
hwmon: (nct6775) use sysfs_emit instead of sprintf
authorFilippo MuscherĂ  <filippo.muschera@gmail.com>
Sun, 1 Feb 2026 20:27:21 +0000 (21:27 +0100)
committerGuenter Roeck <linux@roeck-us.net>
Sat, 7 Feb 2026 17:33:00 +0000 (09:33 -0800)
commitddb2325ed1e1219316bff8f8126be297aedba6b6
tree644a35d2446ef80d4a01a659527e94b1eb6bb413
parenteaeb29ce7c4aecd9652797ee99e90f1523f3fc24
hwmon: (nct6775) use sysfs_emit instead of sprintf

Replace sprintf() with sysfs_emit() in sysfs 'show' functions.
sysfs_emit() is preferred because it automatically handles the
buffer size and PAGE_SIZE boundary checks, preventing potential
buffer overflows.

This aligns the legacy code with the new functions in the driver
that already utilize sysfs_emit.

Signed-off-by: Filippo MuscherĂ  <filippo.muschera@gmail.com>
Link: https://lore.kernel.org/r/20260201202721.3871-1-filippo.muschera@gmail.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
drivers/hwmon/nct6775-core.c