Skip to content

Commit 0e95ed6

Browse files
Ma Junalexdeucher
authored andcommitted
drm/amdgpu/pm: Remove gpu_od if it's an empty directory
gpu_od should be removed if it's an empty directory Signed-off-by: Ma Jun <Jun.Ma2@amd.com> Reported-by: Yang Wang <kevinyang.wang@amd.com> Reviewed-by: Yang Wang <kevinyang.wang@amd.com> Suggested-by: Lijo Lazar <lijo.lazar@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com> Cc: stable@vger.kernel.org
1 parent 9c783a1 commit 0e95ed6

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

drivers/gpu/drm/amd/pm/amdgpu_pm.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4261,6 +4261,13 @@ static int amdgpu_od_set_init(struct amdgpu_device *adev)
42614261
}
42624262
}
42634263

4264+
/*
4265+
* If gpu_od is the only member in the list, that means gpu_od is an
4266+
* empty directory, so remove it.
4267+
*/
4268+
if (list_is_singular(&adev->pm.od_kobj_list))
4269+
goto err_out;
4270+
42644271
return 0;
42654272

42664273
err_out:

0 commit comments

Comments
 (0)