--- zzzz-none-000/linux-4.4.271/drivers/base/soc.c 2021-06-03 06:22:09.000000000 +0000 +++ dakota-7530ac-750/linux-4.4.271/drivers/base/soc.c 2023-01-11 09:25:41.000000000 +0000 @@ -72,13 +72,14 @@ struct soc_device *soc_dev = container_of(dev, struct soc_device, dev); if (attr == &dev_attr_machine) - return sprintf(buf, "%s\n", soc_dev->attr->machine); + return snprintf(buf, PAGE_SIZE, "%s\n", soc_dev->attr->machine); if (attr == &dev_attr_family) - return sprintf(buf, "%s\n", soc_dev->attr->family); + return snprintf(buf, PAGE_SIZE, "%s\n", soc_dev->attr->family); if (attr == &dev_attr_revision) - return sprintf(buf, "%s\n", soc_dev->attr->revision); + return snprintf(buf, PAGE_SIZE, "%s\n", + soc_dev->attr->revision); if (attr == &dev_attr_soc_id) - return sprintf(buf, "%s\n", soc_dev->attr->soc_id); + return snprintf(buf, PAGE_SIZE, "%s\n", soc_dev->attr->soc_id); return -EINVAL;