Replace sprintf() with sysfs_emit() when writing to sysfs buffers.
sysfs_emit() performs proper bounds checking and is the preferred helper
for sysfs output.
No functional change intended
Signed-off-by: Amay Agarwal <tt@turingtested.xyz>
---
drivers/hwmon/tc74.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/hwmon/tc74.c b/drivers/hwmon/tc74.c
index 9984373a25fb..7fb7b50ad1ad 100644
--- a/drivers/hwmon/tc74.c
+++ b/drivers/hwmon/tc74.c
@@ -92,7 +92,7 @@ static ssize_t temp_input_show(struct device *dev,
if (ret)
return ret;
- return sprintf(buf, "%d\n", data->temp_input * 1000);
+ return sysfs_emit(buf, "%d\n", data->temp_input * 1000);
}
static SENSOR_DEVICE_ATTR_RO(temp1_input, temp_input, 0);
--
2.53.0