summaryrefslogtreecommitdiff
path: root/drivers/base/node.c
diff options
context:
space:
mode:
authorJoe Perches <joe@perches.com>2020-09-16 23:40:43 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-10-02 14:16:33 +0300
commit7981593bf083801035b1f1377661849805acb216 (patch)
tree2bbda781606b0bdc05ca2f183a84919d9d5659d3 /drivers/base/node.c
parent948b3edba8988306b635578a72b0dab6091a5eb0 (diff)
downloadlinux-7981593bf083801035b1f1377661849805acb216.tar.xz
mm: and drivers core: Convert hugetlb_report_node_meminfo to sysfs_emit
Convert the unbound sprintf in hugetlb_report_node_meminfo to use sysfs_emit_at so that no possible overrun of a PAGE_SIZE buf can occur. Signed-off-by: Joe Perches <joe@perches.com> Acked-by: Mike Kravetz <mike.kravetz@oracle.com> Link: https://lore.kernel.org/r/894b351b82da6013cde7f36ff4b5493cd0ec30d0.1600285923.git.joe@perches.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/base/node.c')
-rw-r--r--drivers/base/node.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/base/node.c b/drivers/base/node.c
index 96d820f979a2..6366f94f8afb 100644
--- a/drivers/base/node.c
+++ b/drivers/base/node.c
@@ -473,7 +473,7 @@ static ssize_t node_read_meminfo(struct device *dev,
HPAGE_PMD_NR)
#endif
);
- len += hugetlb_report_node_meminfo(nid, buf + len);
+ len += hugetlb_report_node_meminfo(buf, len, nid);
return len;
}