Skip to content

Commit 979e2ec

Browse files
MadhurKumar004Lyude
authored andcommitted
drm: nouveau: Replace sprintf() with sysfs_emit()
Replace sprintf() calls with sysfs_emit() to follow current kernel coding standards. sysfs_emit() is the preferred method for formatting sysfs output as it provides better bounds checking and is more secure. Signed-off-by: Madhur Kumar <madhurkumar004@gmail.com> Reviewed-by: Lyude Paul <lyude@redhat.com> Signed-off-by: Lyude Paul <lyude@redhat.com> Link: https://patch.msgid.link/20251205091804.317801-1-madhurkumar004@gmail.com Fixes: 11b7d89 ("drm/nouveau/pm: manual pwm fanspeed management for nv40+ boards") Cc: <stable@vger.kernel.org> # v3.3+
1 parent d84e47e commit 979e2ec

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

drivers/gpu/drm/nouveau/nouveau_hwmon.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ nouveau_hwmon_get_pwm1_max(struct device *d,
125125
if (ret < 0)
126126
return ret;
127127

128-
return sprintf(buf, "%i\n", ret);
128+
return sysfs_emit(buf, "%i\n", ret);
129129
}
130130

131131
static ssize_t
@@ -141,7 +141,7 @@ nouveau_hwmon_get_pwm1_min(struct device *d,
141141
if (ret < 0)
142142
return ret;
143143

144-
return sprintf(buf, "%i\n", ret);
144+
return sysfs_emit(buf, "%i\n", ret);
145145
}
146146

147147
static ssize_t

0 commit comments

Comments
 (0)