aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/perf/arm_dmc620_pmu.c
diff options
context:
space:
mode:
authorQi Liu <liuqi115@huawei.com>2021-03-19 18:04:33 +0800
committerWill Deacon <will@kernel.org>2021-03-25 12:55:44 +0000
commitfb62d67586afc046f3783d819985c737f6b0b666 (patch)
tree812c6b649bc448360dbdf0c19c40e87f27e7962f /drivers/perf/arm_dmc620_pmu.c
parentdrivers/perf: convert sysfs scnprintf family to sysfs_emit_at() and sysfs_emit() (diff)
downloadlinux-dev-fb62d67586afc046f3783d819985c737f6b0b666.tar.xz
linux-dev-fb62d67586afc046f3783d819985c737f6b0b666.zip
drivers/perf: convert sysfs sprintf family to sysfs_emit
sprintf does not know the PAGE_SIZE maximum of the temporary buffer used for sysfs content and it's possible to overrun the buffer length. Use sysfs_emit() function to ensures that no overrun is done. Signed-off-by: Qi Liu <liuqi115@huawei.com> Link: https://lore.kernel.org/r/1616148273-16374-4-git-send-email-liuqi115@huawei.com Signed-off-by: Will Deacon <will@kernel.org>
Diffstat (limited to 'drivers/perf/arm_dmc620_pmu.c')
-rw-r--r--drivers/perf/arm_dmc620_pmu.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/perf/arm_dmc620_pmu.c b/drivers/perf/arm_dmc620_pmu.c
index f2a85500258d..b6c2511d59af 100644
--- a/drivers/perf/arm_dmc620_pmu.c
+++ b/drivers/perf/arm_dmc620_pmu.c
@@ -113,7 +113,7 @@ dmc620_pmu_event_show(struct device *dev,
eattr = container_of(attr, typeof(*eattr), attr);
- return sprintf(page, "event=0x%x,clkdiv2=0x%x\n", eattr->eventid, eattr->clkdiv2);
+ return sysfs_emit(page, "event=0x%x,clkdiv2=0x%x\n", eattr->eventid, eattr->clkdiv2);
}
#define DMC620_PMU_EVENT_ATTR(_name, _eventid, _clkdiv2) \