mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net.git/
synced 2026-04-18 06:33:43 -04:00
drm/amdgpu: validate sw_init before function call
Before making a function call to sw_init, validate the function pointer like we do in late_init. Signed-off-by: Sunil Khatri <sunil.khatri@amd.com> Reviewed-by: Christian König <christian.koenig@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
committed by
Alex Deucher
parent
10112bf828
commit
df6e463d8f
@@ -2851,11 +2851,13 @@ static int amdgpu_device_ip_init(struct amdgpu_device *adev)
|
||||
for (i = 0; i < adev->num_ip_blocks; i++) {
|
||||
if (!adev->ip_blocks[i].status.valid)
|
||||
continue;
|
||||
r = adev->ip_blocks[i].version->funcs->sw_init(&adev->ip_blocks[i]);
|
||||
if (r) {
|
||||
DRM_ERROR("sw_init of IP block <%s> failed %d\n",
|
||||
adev->ip_blocks[i].version->funcs->name, r);
|
||||
goto init_failed;
|
||||
if (adev->ip_blocks[i].version->funcs->sw_init) {
|
||||
r = adev->ip_blocks[i].version->funcs->sw_init(&adev->ip_blocks[i]);
|
||||
if (r) {
|
||||
DRM_ERROR("sw_init of IP block <%s> failed %d\n",
|
||||
adev->ip_blocks[i].version->funcs->name, r);
|
||||
goto init_failed;
|
||||
}
|
||||
}
|
||||
adev->ip_blocks[i].status.sw = true;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user