diff options
| author | Zilin Guan <zilin@seu.edu.cn> | 2026-01-29 09:05:42 +0000 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2026-02-26 14:59:42 -0800 |
| commit | 9ae85b0c1909b6c6bfd2636b04cdaf7f520bf2b5 (patch) | |
| tree | 12c525a5cb0c8f8258f5b56f09f206e537c6b3b1 /tools/perf/scripts/python/stackcollapse.py | |
| parent | d1370ef2ecf7d4df25e3e1e430cd191b1e7f8596 (diff) | |
drm/amdgpu: Use kvfree instead of kfree in amdgpu_gmc_get_nps_memranges()
[ Upstream commit 0c44d61945c4a80775292d96460aa2f22e62f86c ]
amdgpu_discovery_get_nps_info() internally allocates memory for ranges
using kvcalloc(), which may use vmalloc() for large allocation. Using
kfree() to release vmalloc memory will lead to a memory corruption.
Use kvfree() to safely handle both kmalloc and vmalloc allocations.
Compile tested only. Issue found using a prototype static analysis tool
and code review.
Fixes: b194d21b9bcc ("drm/amdgpu: Use NPS ranges from discovery table")
Reviewed-by: Lijo Lazar <lijo.lazar@amd.com>
Signed-off-by: Zilin Guan <zilin@seu.edu.cn>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'tools/perf/scripts/python/stackcollapse.py')
0 files changed, 0 insertions, 0 deletions
