DORMANTno replies

[PATCH] powerpc: fsl_rio: Use snprintf() in fsl_rio_setup()

From: Thorsten Blum <thorsten.blum@linux.dev>
Date: 2026-06-30 14:55:29
Also in: lkml
Subsystem: linux for powerpc (32-bit and 64-bit), the rest · Maintainers: Madhavan Srinivasan, Michael Ellerman, Linus Torvalds

While the current code works correctly, replace the unbounded sprintf()
with the safer snprintf() in fsl_rio_setup() to follow secure coding
best practices.

Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
---
 arch/powerpc/sysdev/fsl_rio.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/powerpc/sysdev/fsl_rio.c b/arch/powerpc/sysdev/fsl_rio.c
index eb55dabb4748..077c03cd93e4 100644
--- a/arch/powerpc/sysdev/fsl_rio.c
+++ b/arch/powerpc/sysdev/fsl_rio.c
@@ -612,7 +612,7 @@ static int fsl_rio_setup(struct platform_device *dev)
 				kfree(port);
 				continue;
 		}
-		sprintf(port->name, "RIO mport %d", i);
+		snprintf(port->name, sizeof(port->name), "RIO mport %d", i);
 
 		priv->dev = &dev->dev;
 		port->dev.parent = &dev->dev;
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help