mirror of
https://github.com/torvalds/linux.git
synced 2026-05-22 22:22:08 +02:00
drm/amdgpu: Fix null pointer dereference
amdgpu_reg_state_sysfs_fini could be invoked at the time when asic_func is even not initialized, i.e., amdgpu_discovery_init fails for some reason. Signed-off-by: Hawking Zhang <Hawking.Zhang@amd.com> Reviewed-by: Lijo Lazar <lijo.lazar@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
parent
2866a4549c
commit
9bfb1a538a
|
|
@ -138,7 +138,7 @@ static inline size_t amdgpu_reginst_size(uint16_t num_inst, size_t inst_size,
|
|||
}
|
||||
|
||||
#define amdgpu_asic_get_reg_state_supported(adev) \
|
||||
((adev)->asic_funcs->get_reg_state ? 1 : 0)
|
||||
(((adev)->asic_funcs && (adev)->asic_funcs->get_reg_state) ? 1 : 0)
|
||||
|
||||
#define amdgpu_asic_get_reg_state(adev, state, buf, size) \
|
||||
((adev)->asic_funcs->get_reg_state ? \
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user