CC: kbuild-all(a)lists.01.org CC: linux-kernel(a)vger.kernel.org TO: Denis Efremov CC: Julia Lawall CC: Alex Deucher CC: "Christian König" CC: David Airlie CC: Daniel Vetter CC: amd-gfx(a)lists.freedesktop.org CC: dri-devel(a)lists.freedesktop.org CC: linux-kernel(a)vger.kernel.org From: kernel test robot drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c:1950:8-16: WARNING: use scnprintf or sprintf From Documentation/filesystems/sysfs.txt: show() must not use snprintf() when formatting the value to be returned to user space. If you can guarantee that an overflow will never happen you can use sprintf() otherwise you must use scnprintf(). Generated by: scripts/coccinelle/api/device_attr_show.cocci Fixes: abfc19ff202d ("coccinelle: api: add device_attr_show script") CC: Denis Efremov Reported-by: kernel test robot Signed-off-by: kernel test robot --- tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master head: dea8dcf2a9fa8cc540136a6cd885c3beece16ec3 commit: abfc19ff202d287742483e15fd478ddd6ada2187 coccinelle: api: add device_attr_show script :::::: branch date: 10 hours ago :::::: commit date: 5 months ago Please take the patch only if it's a positive warning. Thanks! amdgpu_atombios.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c @@ -1947,7 +1947,7 @@ static ssize_t amdgpu_atombios_get_vbios struct amdgpu_device *adev = drm_to_adev(ddev); struct atom_context *ctx = adev->mode_info.atom_context; - return snprintf(buf, PAGE_SIZE, "%s\n", ctx->vbios_version); + return scnprintf(buf, PAGE_SIZE, "%s\n", ctx->vbios_version); } static DEVICE_ATTR(vbios_version, 0444, amdgpu_atombios_get_vbios_version,