diff options
| author | Haojie Li <lihaojie@kylinos.cn> | 2026-10-02 10:29:27 +0800 |
|---|---|---|
| committer | Alex Deucher <alexander.deucher@amd.com> | 2026-10-07 12:15:48 -0400 |
| commit | ffa699553332f8caf8688d312279ddcea9e3c141 (patch) | |
| tree | 7bd95156f68570826faa2ae937608c815a95d330 /scripts/Makefile.thinlto | |
| parent | f46ffb912ff1e9878640d4ca44ce88fb5da322f6 (diff) | |
| download | linux-ffa699553332f8caf8688d312279ddcea9e3c141.tar.gz linux-ffa699553332f8caf8688d312279ddcea9e3c141.zip | |
drm/amdkfd: fix dma_buf reference leak in get_dmabuf_info
When kzalloc fails for metadata_buffer in
amdgpu_amdkfd_get_dmabuf_info(), the function returns -ENOMEM directly
without calling dma_buf_put(), leaking the dma_buf reference obtained
earlier via dma_buf_get().
Fix both issues by:
- Adding an error check after the first amdgpu_bo_get_metadata() call
- Replacing the direct return with r = -ENOMEM and goto out_put to
ensure dma_buf_put() is called on all error paths
Fixes: f54ce9e8cbd3 ("drm/amdkfd: Let driver decide buffer size at AMDKFD_IOC_GET_DMABUF_INFO ioctl")
Signed-off-by: Haojie Li <lihaojie@kylinos.cn>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'scripts/Makefile.thinlto')
0 files changed, 0 insertions, 0 deletions
