Skip to content

Commit 0c44b46

Browse files
arndbij-intel
authored andcommitted
platform/x86/intel-uncore-freq: avoid non-literal format string
Using a string variable in place of a format string causes a W=1 build warning: drivers/platform/x86/intel/uncore-frequency/uncore-frequency-common.c:61:40: error: format string is not a string literal (potentially insecure) [-Werror,-Wformat-security] 61 | length += sysfs_emit_at(buf, length, agent_name[agent]); | ^~~~~~~~~~~~~~~~~ Use the safer "%s" format string to print it instead. Fixes: b98fa87 ("platform/x86/intel-uncore-freq: Add attributes to show agent types") Signed-off-by: Arnd Bergmann <[email protected]> Tested-by: Srinivas Pandruvada <[email protected]> Link: https://lore.kernel.org/r/[email protected] Reviewed-by: Ilpo Järvinen <[email protected]> Signed-off-by: Ilpo Järvinen <[email protected]>
1 parent be574d5 commit 0c44b46

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/platform/x86/intel/uncore-frequency/uncore-frequency-common.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ static ssize_t show_agent_types(struct kobject *kobj, struct kobj_attribute *att
5858
if (length)
5959
length += sysfs_emit_at(buf, length, " ");
6060

61-
length += sysfs_emit_at(buf, length, agent_name[agent]);
61+
length += sysfs_emit_at(buf, length, "%s", agent_name[agent]);
6262
}
6363

6464
length += sysfs_emit_at(buf, length, "\n");

0 commit comments

Comments
 (0)