Commit 117e2cb3 authored by Chen Zhou's avatar Chen Zhou Committed by David S. Miller

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: default avatarChen Zhou <chenzhou10@huawei.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 03a1b56f
...@@ -193,7 +193,7 @@ show_pciobppath_attr(struct device *dev, struct device_attribute *attr, ...@@ -193,7 +193,7 @@ show_pciobppath_attr(struct device *dev, struct device_attribute *attr,
vdev = to_vio_dev(dev); vdev = to_vio_dev(dev);
dp = vdev->dp; 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, static DEVICE_ATTR(obppath, S_IRUSR | S_IRGRP | S_IROTH,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment