[Devel] [PATCH hci-8.1] drm/amdgpu: free the buddy allocator when dmem region registration fails
no-reply at sashiko.virtuozzo.com
no-reply at sashiko.virtuozzo.com
Mon Nov 16 06:45:52 MSK 2026
Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Low] drm/amdgpu: Fixes tag cites ffbc4c6f4d0b, not in baseline
history
--
commit 6e9e31d0a13bdda4472b468f1406f2c15cf25c56
Author: Mirian Shilakadze <mirian.shilakadze at virtuozzo.com>
drm/amdgpu: free the buddy allocator when dmem region registration fails
When drmm_cgroup_register_region() fails in amdgpu_vram_mgr_init(), the function now calls drm_buddy_fini() before returning the error. Previously the buddy allocator initialised just before was leaked.
> drm/amdgpu: free the buddy allocator when dmem region registration fails
>
> Since commit ffbc4c6f4d0b ("ms/drm/amdgpu: Fix init ordering in
> amdgpu_vram_mgr_init()") the dmem cgroup region is registered after
> drm_buddy_init(). When drmm_cgroup_register_region() fails,
> amdgpu_vram_mgr_init() returns without drm_buddy_fini(), so a probe
> failing there leaks the buddy allocator.
>
> Free it on that error path. Upstream does the same in commit
> bd4f284df04d ("drm/amdgpu: Wire up dmem cgroup reclaim for VRAM
> manager"), which also wires up dmem reclaim and is not taken here.
>
> Fixes: ffbc4c6f4d0b ("ms/drm/amdgpu: Fix init ordering in amdgpu_vram_mgr_init()")
> https://virtuozzo.atlassian.net/browse/VSTOR-154845
> Feature: fix ms/drm
> Signed-off-by: Mirian Shilakadze <mirian.shilakadze at virtuozzo.com>
[Severity: Low]
Does the Fixes: tag name the right commit? ffbc4c6f4d0b is not in the baseline history, so the tag and the "Since commit" sentence do not resolve on this branch. The commit already on the branch that moved drmm_cgroup_register_region() after drm_buddy_init(), and so opened this leak, is 6221d6dc707e ("ms/drm/amdgpu: Fix init ordering in amdgpu_vram_mgr_init()"). Should both references be changed to it?
--
Sashiko AI review · https://sashiko.vzint.dev/#/patchset/20261116033832.26787-1-mirian.shilakadze@virtuozzo.com?part=1
More information about the Devel
mailing list