diff --git a/drivers/media/media-device.c b/drivers/media/media-device.c index e79f72b8b858..f44244415124 100644 --- a/drivers/media/media-device.c +++ b/drivers/media/media-device.c @@ -255,7 +255,7 @@ static long media_device_get_topology(struct media_device *mdev, memset(&kentity, 0, sizeof(kentity)); kentity.id = entity->graph_obj.id; kentity.function = entity->function; - strncpy(kentity.name, entity->name, + strlcpy(kentity.name, entity->name, sizeof(kentity.name)); if (copy_to_user(uentity, &kentity, sizeof(kentity)))