Skip to contentSkip to conversation

drm/amdgpu: Fix a memory leak

PATCH In review Luben Tuikov 2 participants 2 messages Sep 22, 2023 – Sep 25, 2023

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/amdgpu: Fix a memory leak

Fix a memory leak in amdgpu_fru_get_product_info().

Cc Alex Deucher <[email protected]>
Fixes 0dbf2c56262532 ("drm/amdgpu: Interpret IPMI data for product information (v2)")
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_fru_eeprom.c | 1 +
 1 file changed, 1 insertion(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_fru_eeprom.c +1 -0
index 9c66d98af6d86a..7cd0dfaeee206c 100644
@@ -170,6 +170,7 @@ int amdgpu_fru_get_product_info(struct amdgpu_device *adev)
 		csum += pia[size - 1];
 	if (csum) {
 		DRM_ERROR("Bad Product Info Area checksum: 0x%02x", csum);
+		kfree(pia);
 		return -EIO;
 	}
 

base-commit: 14d13f757d369c9873ebbe34d02d0896f5de565e

Signature · 1 line
2.42.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 6 lines · Luben Tuikov

Fix a memory leak in amdgpu_fru_get_product_info().

Cc Alex Deucher <[email protected]>
Fixes 0dbf2c56262532 ("drm/amdgpu: Interpret IPMI data for product information (v2)")
Quoted 21 lines
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_fru_eeprom.c | 1 +
 1 file changed, 1 insertion(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_fru_eeprom.c +1 -0
index 9c66d98af6d86a..7cd0dfaeee206c 100644
@@ -170,6 +170,7 @@ int amdgpu_fru_get_product_info(struct amdgpu_device *adev)
                csum += pia[size - 1];
        if (csum) {
                DRM_ERROR("Bad Product Info Area checksum: 0x%02x", csum);
+               kfree(pia);
                return -EIO;
        }
 

base-commit: 14d13f757d369c9873ebbe34d02d0896f5de565e --
2.42.0