diff options
author | Bjorn Helgaas <bhelgaas@google.com> | 2021-11-05 11:28:50 -0500 |
---|---|---|
committer | Bjorn Helgaas <bhelgaas@google.com> | 2021-11-05 11:28:50 -0500 |
commit | fd6c10ca26f5dd02bebc131bca6cad8b182bd6df (patch) | |
tree | 4e1dda475f6d987a31aae3916a5cba589d2a6e50 /drivers/pci/endpoint/functions | |
parent | 07dd8bbec131d0b1af444feeb1e744192cf94819 (diff) | |
parent | a2258831d12d7845946f9c98f08d65aad9aa1121 (diff) |
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')
-rw-r--r-- | drivers/pci/endpoint/functions/pci-epf-ntb.c | 4 |
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) \ |