Skip to content

Commit 4947272

Browse files
arndbbp3tk0v
authored andcommitted
EDAC/device: Fix dev_set_name() format string
Passing a variable string as the format to dev_set_name() causes a W=1 warning: drivers/edac/edac_device.c:736:9: error: format not a string literal and no format arguments [-Werror=format-security] 736 | ret = dev_set_name(&ctx->dev, name); | ^~~ Use a literal "%s" instead so the name can be the argument. Fixes: db99ea5 ("EDAC: Add support for EDAC device features control") Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de> Link: https://lore.kernel.org/r/20250304143603.995820-1-arnd@kernel.org
1 parent 81e42fc commit 4947272

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/edac/edac_device.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -733,7 +733,7 @@ int edac_dev_register(struct device *parent, char *name,
733733
ctx->private = private;
734734
dev_set_drvdata(&ctx->dev, ctx);
735735

736-
ret = dev_set_name(&ctx->dev, name);
736+
ret = dev_set_name(&ctx->dev, "%s", name);
737737
if (ret)
738738
goto data_mem_free;
739739

0 commit comments

Comments
 (0)