From patchwork Tue Sep 29 10:55:52 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 263055 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.5 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9AED2C4727F for ; Tue, 29 Sep 2020 12:15:40 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4A4D02075A for ; Tue, 29 Sep 2020 12:15:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1601381740; bh=mqHT6RbFDr81GU1HO9Nq0bacZnanhKGb6BtrvhIrp9c=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=MWs0fcutluR4qtzNpBPjS+GNsvFMqDzgJzNsOlhhvik160GoEpO8QjWHLP3+l9lJz Tp8dQh7sm7Gh3QPWAGbhzy5ekzpjOUYSvrypyoVGGeMyn+YBqiyXEzQJXzgC1e3dzP tm+Y8eHNxZ+RvBoOnzz2bZrTknfg8bnrtw6hDnDE= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732213AbgI2MPQ (ORCPT ); Tue, 29 Sep 2020 08:15:16 -0400 Received: from mail.kernel.org ([198.145.29.99]:54448 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730084AbgI2Lh2 (ORCPT ); Tue, 29 Sep 2020 07:37:28 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 1CFAB2074A; Tue, 29 Sep 2020 11:33:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1601379210; bh=mqHT6RbFDr81GU1HO9Nq0bacZnanhKGb6BtrvhIrp9c=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=hoOfl3GFuDymSBhUeIX6BiLPwFycfOilz5lZtocVD4jSggJEY77trhtFetjib1v1m h0Btqx3JrUvmlGkK5xOFLeJlPXn5x1L3eXY73io/yN40qkK2Ch9rKj/hB0Ry9OitXX r2+t1WSwG2vUdjFXxRcwh4WgfMwTcDUvE+U5jZMU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Nicholas Kazlauskas , Leo Li , Alex Deucher , Sasha Levin Subject: [PATCH 5.4 021/388] drm/amd/display: Free gamma after calculating legacy transfer function Date: Tue, 29 Sep 2020 12:55:52 +0200 Message-Id: <20200929110011.510051783@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200929110010.467764689@linuxfoundation.org> References: <20200929110010.467764689@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Nicholas Kazlauskas [ Upstream commit 0e3a7c2ec93b15f43a2653e52e9608484391aeaf ] [Why] We're leaking memory by not freeing the gamma used to calculate the transfer function for legacy gamma. [How] Release the gamma after we're done with it. Signed-off-by: Nicholas Kazlauskas Reviewed-by: Leo Li Signed-off-by: Alex Deucher Signed-off-by: Sasha Levin --- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_color.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_color.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_color.c index b43bb7f90e4e9..2233d293a707a 100644 --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_color.c +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_color.c @@ -210,6 +210,8 @@ static int __set_legacy_tf(struct dc_transfer_func *func, res = mod_color_calculate_regamma_params(func, gamma, true, has_rom, NULL); + dc_gamma_release(&gamma); + return res ? 0 : -ENOMEM; }