]> git.baikalelectronics.ru Git - kernel.git/commit
drm/amdgpu: fix warning in ras_debugfs_create_all()
authorStanley.Yang <Stanley.Yang@amd.com>
Thu, 12 Mar 2020 10:18:39 +0000 (18:18 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Fri, 13 Mar 2020 15:52:34 +0000 (11:52 -0400)
commitb541db32349258d84882467d974ee1dfabd14909
treeaae84156bb4516db934eb18c86ced8bc12e3eaea
parentfb5b85f148462c9312059c1519521ccddff10f35
drm/amdgpu: fix warning in ras_debugfs_create_all()

Fix the warning
"warn: variable dereferenced before check 'obj' (see line 1131)"
by removing unnecessary checks as amdgpu_ras_debugfs_create_all()
is only called from amdgpu_debugfs_init() where obj member in
con->head list is not NULL.
Use list_for_each_entry() instead list_for_each_entry_safe() as obj
do not to be freeing or removing from list during this process.

Signed-off-by: Stanley.Yang <Stanley.Yang@amd.com>
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c