drm/amdgpu: Fix the null pointer when load rlc firmware
authorMa Jun <Jun.Ma2@amd.com>
Fri, 12 Jan 2024 05:33:24 +0000 (13:33 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 1 Feb 2024 00:19:07 +0000 (16:19 -0800)
commit8b5bacce2d13dbe648f0bfd3f738ecce8db4978c
tree6d3ce3cdbcee936a4444f3fbbbbfe260269b57b0
parente256f6d364968cb22463bbb3b6fe707bf304ca61
drm/amdgpu: Fix the null pointer when load rlc firmware

commit bc03c02cc1991a066b23e69bbcc0f66e8f1f7453 upstream.

If the RLC firmware is invalid because of wrong header size,
the pointer to the rlc firmware is released in function
amdgpu_ucode_request. There will be a null pointer error
in subsequent use. So skip validation to fix it.

Fixes: 3da9b71563cb ("drm/amd: Use `amdgpu_ucode_*` helpers for GFX10")
Signed-off-by: Ma Jun <Jun.Ma2@amd.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c