Skip to content

Commit 28afcb0

Browse files
Luben Tuikovalexdeucher
authored andcommitted
drm/amdgpu: Check if fru_addr is not NULL (v2)
Always check if fru_addr is not NULL. This commit also fixes a "smatch" warning. v2: Add a Fixes tag. Cc: Alex Deucher <Alexander.Deucher@amd.com> Cc: Dan Carpenter <error27@gmail.com> Cc: kernel test robot <lkp@intel.com> Cc: AMD Graphics <amd-gfx@lists.freedesktop.org> Fixes: afbe5d1 ("drm/amdgpu: Bug-fix: Reading I2C FRU data on newer ASICs") Signed-off-by: Luben Tuikov <luben.tuikov@amd.com> Reviewed-by: Kent Russell <kent.russell@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
1 parent e44a0fe commit 28afcb0

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

drivers/gpu/drm/amd/amdgpu/amdgpu_fru_eeprom.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,8 @@ static bool is_fru_eeprom_supported(struct amdgpu_device *adev, u32 *fru_addr)
6464
sizeof(atom_ctx->vbios_version)) ||
6565
strnstr(atom_ctx->vbios_version, "D163",
6666
sizeof(atom_ctx->vbios_version))) {
67-
*fru_addr = FRU_EEPROM_MADDR_6;
67+
if (fru_addr)
68+
*fru_addr = FRU_EEPROM_MADDR_6;
6869
return true;
6970
} else {
7071
return false;
@@ -83,7 +84,8 @@ static bool is_fru_eeprom_supported(struct amdgpu_device *adev, u32 *fru_addr)
8384
sizeof(atom_ctx->vbios_version))) {
8485
return false;
8586
} else {
86-
*fru_addr = FRU_EEPROM_MADDR_6;
87+
if (fru_addr)
88+
*fru_addr = FRU_EEPROM_MADDR_6;
8789
return true;
8890
}
8991
} else {

0 commit comments

Comments
 (0)