mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-26 10:49:33 +00:00
sparc: use scnprintf() in show_pciobppath_attr() in vio.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>
This commit is contained in:
parent
03a1b56f50
commit
117e2cb3ee
1 changed files with 1 additions and 1 deletions
|
@ -193,7 +193,7 @@ show_pciobppath_attr(struct device *dev, struct device_attribute *attr,
|
|||
vdev = to_vio_dev(dev);
|
||||
dp = vdev->dp;
|
||||
|
||||
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,
|
||||
|
|
Loading…
Reference in a new issue