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 <[email protected]> Cc: Dan Carpenter <[email protected]> Cc: kernel test robot <[email protected]> Cc: AMD Graphics <[email protected]> Fixes: afbe5d1 ("drm/amdgpu: Bug-fix: Reading I2C FRU data on newer ASICs") Signed-off-by: Luben Tuikov <[email protected]> Reviewed-by: Kent Russell <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
1 parent e44a0fe commit 28afcb0

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

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)