From: Likun Gao <[email protected]>

If DF function not initialized, NULL pointer issue
will happen on soc24.

Signed-off-by: Likun Gao <[email protected]>
Reviewed-by: Hawking Zhang <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
---
 drivers/gpu/drm/amd/amdgpu/soc24.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/soc24.c 
b/drivers/gpu/drm/amd/amdgpu/soc24.c
index 972b449ab89fa..cc6684f265384 100644
--- a/drivers/gpu/drm/amd/amdgpu/soc24.c
+++ b/drivers/gpu/drm/amd/amdgpu/soc24.c
@@ -489,7 +489,7 @@ static int soc24_common_hw_init(struct amdgpu_ip_block 
*ip_block)
        if (adev->nbio.funcs->remap_hdp_registers)
                adev->nbio.funcs->remap_hdp_registers(adev);
 
-       if (adev->df.funcs->hw_init)
+       if (adev->df.funcs && adev->df.funcs->hw_init)
                adev->df.funcs->hw_init(adev);
 
        /* enable the doorbell aperture */
-- 
2.51.0

Reply via email to