diff options
author | Md Haris Iqbal <haris.iqbal@ionos.com> | 2021-09-22 14:53:27 +0200 |
---|---|---|
committer | Jason Gunthorpe <jgg@nvidia.com> | 2021-10-04 16:46:11 -0300 |
commit | 2f232912feec57d73b22cb26dcdf687846917e9e (patch) | |
tree | 593d66b65052f211efa4e464caf7ba599585e19b /drivers/infiniband/ulp/rtrs/rtrs-srv-sysfs.c | |
parent | RDMA/cma: Split apart the multiple uses of the same list heads (diff) | |
download | linux-dev-2f232912feec57d73b22cb26dcdf687846917e9e.tar.xz linux-dev-2f232912feec57d73b22cb26dcdf687846917e9e.zip |
RDMA/rtrs: Use sysfs_emit instead of s*printf function for sysfs show
sysfs_emit function was added to be aware of the PAGE_SIZE maximum of the
temporary buffer used for outputting sysfs content, so there is no
possible overruns. So replace the uses of any s*printf functions for the
sysfs show functions with sysfs_emit.
Link: https://lore.kernel.org/r/20210922125333.351454-2-haris.iqbal@ionos.com
Signed-off-by: Md Haris Iqbal <haris.iqbal@ionos.com>
Signed-off-by: Jack Wang <jinpu.wang@ionos.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Diffstat (limited to '')
-rw-r--r-- | drivers/infiniband/ulp/rtrs/rtrs-srv-sysfs.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/infiniband/ulp/rtrs/rtrs-srv-sysfs.c b/drivers/infiniband/ulp/rtrs/rtrs-srv-sysfs.c index 20efd44297fb..9c43ce5ba1c1 100644 --- a/drivers/infiniband/ulp/rtrs/rtrs-srv-sysfs.c +++ b/drivers/infiniband/ulp/rtrs/rtrs-srv-sysfs.c @@ -102,7 +102,7 @@ static ssize_t rtrs_srv_src_addr_show(struct kobject *kobj, sess = container_of(kobj, struct rtrs_srv_sess, kobj); cnt = sockaddr_to_str((struct sockaddr *)&sess->s.dst_addr, page, PAGE_SIZE); - return cnt + scnprintf(page + cnt, PAGE_SIZE - cnt, "\n"); + return cnt + sysfs_emit_at(page, cnt, "\n"); } static struct kobj_attribute rtrs_srv_src_addr_attr = |