summaryrefslogtreecommitdiff
path: root/drivers/pci/endpoint/functions/pci-epf-ntb.c
diff options
context:
space:
mode:
authorBjorn Helgaas <bhelgaas@google.com>2021-11-05 19:28:50 +0300
committerBjorn Helgaas <bhelgaas@google.com>2021-11-05 19:28:50 +0300
commitfd6c10ca26f5dd02bebc131bca6cad8b182bd6df (patch)
tree4e1dda475f6d987a31aae3916a5cba589d2a6e50 /drivers/pci/endpoint/functions/pci-epf-ntb.c
parent07dd8bbec131d0b1af444feeb1e744192cf94819 (diff)
parenta2258831d12d7845946f9c98f08d65aad9aa1121 (diff)
downloadlinux-fd6c10ca26f5dd02bebc131bca6cad8b182bd6df.tar.xz
Merge branch 'remotes/lorenzo/pci/endpoint'
- Use sysfs_emit() in "show" functions instead of sprintf() to avoid buffer overruns (Kunihiko Hayashi) * remotes/lorenzo/pci/endpoint: PCI: endpoint: Use sysfs_emit() in "show" functions
Diffstat (limited to 'drivers/pci/endpoint/functions/pci-epf-ntb.c')
-rw-r--r--drivers/pci/endpoint/functions/pci-epf-ntb.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/pci/endpoint/functions/pci-epf-ntb.c b/drivers/pci/endpoint/functions/pci-epf-ntb.c
index e67489144349..5a03401f4571 100644
--- a/drivers/pci/endpoint/functions/pci-epf-ntb.c
+++ b/drivers/pci/endpoint/functions/pci-epf-ntb.c
@@ -1937,7 +1937,7 @@ static ssize_t epf_ntb_##_name##_show(struct config_item *item, \
struct config_group *group = to_config_group(item); \
struct epf_ntb *ntb = to_epf_ntb(group); \
\
- return sprintf(page, "%d\n", ntb->_name); \
+ return sysfs_emit(page, "%d\n", ntb->_name); \
}
#define EPF_NTB_W(_name) \
@@ -1966,7 +1966,7 @@ static ssize_t epf_ntb_##_name##_show(struct config_item *item, \
\
sscanf(#_name, "mw%d", &win_no); \
\
- return sprintf(page, "%lld\n", ntb->mws_size[win_no - 1]); \
+ return sysfs_emit(page, "%lld\n", ntb->mws_size[win_no - 1]); \
}
#define EPF_NTB_MW_W(_name) \