drm/amdgpu: fix mem leak in atombios
authorMonk Liu <Monk.Liu@amd.com>
Fri, 27 May 2016 11:34:11 +0000 (19:34 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 9 Jun 2016 14:49:04 +0000 (10:49 -0400)
Signed-off-by: Monk Liu <Monk.Liu@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c

index 1727a4d998a42aef55c96ae13a803fe540bc06cf..964f31404f17a9ddad381ed1bbac3c6fbcd36fe4 100644 (file)
@@ -827,8 +827,10 @@ static uint32_t cail_ioreg_read(struct card_info *info, uint32_t reg)
  */
 static void amdgpu_atombios_fini(struct amdgpu_device *adev)
 {
-       if (adev->mode_info.atom_context)
+       if (adev->mode_info.atom_context) {
                kfree(adev->mode_info.atom_context->scratch);
+               kfree(adev->mode_info.atom_context->iio);
+       }
        kfree(adev->mode_info.atom_context);
        adev->mode_info.atom_context = NULL;
        kfree(adev->mode_info.atom_card_info);