arm64: perf: Convert snprintf to sysfs_emit
authorTian Tao <tiantao6@hisilicon.com>
Thu, 20 May 2021 07:59:45 +0000 (15:59 +0800)
committerWill Deacon <will@kernel.org>
Tue, 1 Jun 2021 13:18:23 +0000 (14:18 +0100)
commita5740e955540181f4ab8f076cc9795c6bbe4d730
tree3d735ba7d7c8ce378b6ca0b58f351ca42b246180
parentfdbef8c4e68ad423416aa6cc93d1616d6f8ac5b3
arm64: perf: Convert snprintf to sysfs_emit

Use sysfs_emit instead of snprintf to avoid buf overrun,because in
sysfs_emit it strictly checks whether buf is null or buf whether
pagesize aligned, otherwise it returns an error.

Signed-off-by: Tian Tao <tiantao6@hisilicon.com>
Link: https://lore.kernel.org/r/1621497585-30887-1-git-send-email-tiantao6@hisilicon.com
Signed-off-by: Will Deacon <will@kernel.org>
arch/arm64/kernel/perf_event.c