From 4175a6c0e964dfbe53557b9a74a9ec1005fe5303 Mon Sep 17 00:00:00 2001 From: David Laight Date: Mon, 8 Jun 2026 10:54:56 +0100 Subject: [PATCH] drivers/bus/fsl-mc: Use strscpy() to copy strings into arrays Replacing strcpy() with strscpy() ensures than overflow of the target buffer cannot happen. Signed-off-by: David Laight Reviewed-by: Ioana Ciornei Link: https://lore.kernel.org/r/20260608095500.2567-1-david.laight.linux@gmail.com Signed-off-by: Christophe Leroy (CS GROUP) --- drivers/bus/fsl-mc/fsl-mc-bus.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/bus/fsl-mc/fsl-mc-bus.c b/drivers/bus/fsl-mc/fsl-mc-bus.c index 64d75eed0d34..8c203cd47534 100644 --- a/drivers/bus/fsl-mc/fsl-mc-bus.c +++ b/drivers/bus/fsl-mc/fsl-mc-bus.c @@ -908,7 +908,7 @@ struct fsl_mc_device *fsl_mc_get_endpoint(struct fsl_mc_device *mc_dev, int state, err; mc_bus_dev = to_fsl_mc_device(mc_dev->dev.parent); - strcpy(endpoint1.type, mc_dev->obj_desc.type); + strscpy(endpoint1.type, mc_dev->obj_desc.type); endpoint1.id = mc_dev->obj_desc.id; endpoint1.if_id = if_id; @@ -925,7 +925,7 @@ struct fsl_mc_device *fsl_mc_get_endpoint(struct fsl_mc_device *mc_dev, return ERR_PTR(err); } - strcpy(endpoint_desc.type, endpoint2.type); + strscpy(endpoint_desc.type, endpoint2.type); endpoint_desc.id = endpoint2.id; endpoint = fsl_mc_device_lookup(&endpoint_desc, mc_bus_dev); if (endpoint)