[PATCH 2/3] sh: dma-sysfs: use strscpy in dma_store_dev_id
From: Thorsten Blum
Date: Mon May 18 2026 - 13:16:11 EST
strcpy() has been deprecated¹ because it performs no bounds checking on
the destination buffer, which can lead to buffer overflows. Replace it
with the safer strscpy().
¹ https://www.kernel.org/doc/html/latest/process/deprecated.html#strcpy
Reviewed-by: Geert Uytterhoeven <geert+renesas@xxxxxxxxx>
Signed-off-by: Thorsten Blum <thorsten.blum@xxxxxxxxx>
---
arch/sh/drivers/dma/dma-sysfs.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/sh/drivers/dma/dma-sysfs.c b/arch/sh/drivers/dma/dma-sysfs.c
index d4e16cfc7a12..d1d6b9bb0d7e 100644
--- a/arch/sh/drivers/dma/dma-sysfs.c
+++ b/arch/sh/drivers/dma/dma-sysfs.c
@@ -74,7 +74,7 @@ static ssize_t dma_store_dev_id(struct device *dev,
const char *buf, size_t count)
{
struct dma_channel *channel = to_dma_channel(dev);
- strcpy(channel->dev_id, buf);
+ strscpy(channel->dev_id, buf);
return count;
}