summaryrefslogtreecommitdiffstats
path: root/arch/sparc
diff options
context:
space:
mode:
authorChen Zhou <chenzhou10@huawei.com>2020-05-09 17:18:48 +0800
committerDavid S. Miller <davem@davemloft.net>2020-05-13 15:35:58 -0700
commit03a1b56f501ef4f8c54cb89a5f5ed7cc9ccac38f (patch)
tree1eb6264d1cdcabb6738cadb35c46f67985505390 /arch/sparc
parent9ef391bdc29f0570c2be578210e220d15ea7a453 (diff)
downloadlinux-03a1b56f501ef4f8c54cb89a5f5ed7cc9ccac38f.tar.bz2
sparc: use scnprintf() in show_pciobppath_attr() in pci.c
snprintf() returns the number of bytes that would be written, which may be greater than the the actual length to be written. show_pciobppath_attr() should return the number of bytes printed into the buffer. This is the return value of scnprintf(). Signed-off-by: Chen Zhou <chenzhou10@huawei.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'arch/sparc')
-rw-r--r--arch/sparc/kernel/pci.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/sparc/kernel/pci.c b/arch/sparc/kernel/pci.c
index 5ed43828e078..a41ad562ed4e 100644
--- a/arch/sparc/kernel/pci.c
+++ b/arch/sparc/kernel/pci.c
@@ -593,7 +593,7 @@ show_pciobppath_attr(struct device * dev, struct device_attribute * attr, char *
pdev = to_pci_dev(dev);
dp = pdev->dev.of_node;
- return snprintf (buf, PAGE_SIZE, "%pOF\n", dp);
+ return scnprintf(buf, PAGE_SIZE, "%pOF\n", dp);
}
static DEVICE_ATTR(obppath, S_IRUSR | S_IRGRP | S_IROTH, show_pciobppath_attr, NULL);