[PATCH] staging: atomisp: replace sprintf with strscpy

From: tomasz . unger

Date: Wed Feb 25 2026 - 15:46:43 EST


From: Tomasz Unger <tomasz.unger@xxxxxxxx>

Replace deprecated sprintf() with strscpy() which is the preferred
kernel API for string copying. strscpy() is safer as it guarantees
null-termination and prevents potential buffer overflows.

Since sd->name is a fixed-size array, the destination buffer size
is deduced automatically by the kernel-defined strscpy() macro,
so no explicit size parameter is needed.

Compiled and tested by loading atomisp.ko module successfully.

Signed-off-by: Tomasz Unger <tomasz.unger@xxxxxxxx>
---
drivers/staging/media/atomisp/pci/atomisp_subdev.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/media/atomisp/pci/atomisp_subdev.c b/drivers/staging/media/atomisp/pci/atomisp_subdev.c
index 3d56ca83ecb7..cef44ec9ebde 100644
--- a/drivers/staging/media/atomisp/pci/atomisp_subdev.c
+++ b/drivers/staging/media/atomisp/pci/atomisp_subdev.c
@@ -808,7 +808,7 @@ static int isp_subdev_init_entities(struct atomisp_sub_device *asd)
int ret;

v4l2_subdev_init(sd, &isp_subdev_v4l2_ops);
- sprintf(sd->name, "Atom ISP");
+ strscpy(sd->name, "Atom ISP");
v4l2_set_subdevdata(sd, asd);
sd->flags |= V4L2_SUBDEV_FL_HAS_EVENTS | V4L2_SUBDEV_FL_HAS_DEVNODE;

--
2.53.0