drm/amdgpu: Fix a memory leak
authorLuben Tuikov <luben.tuikov@amd.com>
Fri, 22 Sep 2023 21:21:21 +0000 (17:21 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 5 Oct 2023 02:43:26 +0000 (22:43 -0400)
Fix a memory leak in amdgpu_fru_get_product_info().

Cc: Alex Deucher <Alexander.Deucher@amd.com>
Reported-by: Yang Wang <kevinyang.wang@amd.com>
Fixes: 0dbf2c562625 ("drm/amdgpu: Interpret IPMI data for product information (v2)")
Signed-off-by: Luben Tuikov <luben.tuikov@amd.com>
Reviewed-by: Alex Deucher <Alexander.Deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_fru_eeprom.c

index 9c66d98..7cd0dfa 100644 (file)
@@ -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;
        }