]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
accel/amdxdna: Adjust size for copy_to_user()
authorLizhi Hou <lizhi.hou@amd.com>
Thu, 2 Apr 2026 17:41:48 +0000 (10:41 -0700)
committerLizhi Hou <lizhi.hou@amd.com>
Fri, 3 Apr 2026 17:57:07 +0000 (10:57 -0700)
commit6e87001fe19f251e2ae14373bc76554358a13df2
treed37a004e8fa3b58dc925f4210e186269e6ad1667
parentfb42964e2a76f68a5fb581d382b5d2be2d5bda9b
accel/amdxdna: Adjust size for copy_to_user()

The amount of data returned to user space should be limited by the buffer
size provided by the application. If the buffer is smaller than the data
size, return only the portion that fits instead of failing.

Fixes: 850d71f6bf4c ("accel/amdxdna: Add query functions")
Reviewed-by: Mario Limonciello (AMD) <superm1@kernel.org>
Signed-off-by: Lizhi Hou <lizhi.hou@amd.com>
Link: https://patch.msgid.link/20260402174148.3527757-1-lizhi.hou@amd.com
drivers/accel/amdxdna/aie2_error.c
drivers/accel/amdxdna/aie2_message.c
drivers/accel/amdxdna/aie2_pci.c