diff options
author | Nicholas Kazlauskas <nicholas.kazlauskas@amd.com> | 2020-04-30 12:24:05 -0400 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2020-05-28 14:00:48 -0400 |
commit | 0922b899f36621126d49c0d86e90fb18d572d8a1 (patch) | |
tree | c39cb076285ca9218b6672cbf97b1ec23b57754b | |
parent | 08a512d4ab2f32c6b06ea89bb8a707a66c3ec13d (diff) | |
download | linux-0922b899f36621126d49c0d86e90fb18d572d8a1.tar.bz2 |
drm/amd/display: Don't pass invalid fw_bss_data pointer into DMUB srv
[Why]
If bss_data_size is 0 then we shouldn't be passing down fw_bss_data into
the DMUB service since the region isn't really "valid."
[How]
Pass NULL instead if the size is 0.
Signed-off-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
Reviewed-by: Zhan Liu <Zhan.Liu@amd.com>
Acked-by: Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
-rw-r--r-- | drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c index d53c60b37cc6..2b975a1c7665 100644 --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c @@ -1228,10 +1228,10 @@ static int dm_dmub_sw_init(struct amdgpu_device *adev) PSP_HEADER_BYTES - PSP_FOOTER_BYTES; region_params.bss_data_size = le32_to_cpu(hdr->bss_data_bytes); region_params.vbios_size = adev->bios_size; - region_params.fw_bss_data = + region_params.fw_bss_data = region_params.bss_data_size ? adev->dm.dmub_fw->data + le32_to_cpu(hdr->header.ucode_array_offset_bytes) + - le32_to_cpu(hdr->inst_const_bytes); + le32_to_cpu(hdr->inst_const_bytes) : NULL; region_params.fw_inst_const = adev->dm.dmub_fw->data + le32_to_cpu(hdr->header.ucode_array_offset_bytes) + |