Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp3743571pxk; Tue, 29 Sep 2020 05:18:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwEPjoblez09/PJTQziyTLlvzUEmUPsT1jud8UrD7O+gmh+cr0n/tVC12nM/LL72z3pHCH2 X-Received: by 2002:aa7:d40f:: with SMTP id z15mr2992852edq.247.1601381937180; Tue, 29 Sep 2020 05:18:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1601381937; cv=none; d=google.com; s=arc-20160816; b=SyXUXFJOql7ewMWg6wo1rxPkzbi82LQhgX9OGEGMnpIDHlWJox+xfCqI9U2D8wRz2K nVE4V1ZwJojkjtBel69PLMFAGZQurbg1G78cm5AvWS+zOv8nYKDohc+hknCmMQwxnA02 rt/nctRev5EM5w0xhzptJLIZc2ZGlPYzA5moLcKBu2vtF5vJBslg70F8HuPJsrFQ1fHW QAnnVg1GFY0nXrHFTiuMsNTbtVIfaAc4nLp3ObEUMPeMgl665zDhCDum5lB6gFgqoRCc k0dU0SnGg0hDD5NnF5gQsouulR/fKcAPxbrlTebe2FWCfi14qtnUiaQZfRNO9vw1kov1 kRBw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=CGgsXuLu0+T3PJrPZExWBcw4+VO/sWRQqOnio97xbe8=; b=lG4iy62u4FvXHR10XU5y7cw7O6Con3zUBvKGb+8M0xj2mcGMLCNtZc9ii45WIZDIUB goXnWixgWrG+xpG7xrQo3nbi7+uUKokL14Svg+/M5dBxUc73pX8a3boRH33/YJF6rwKi 3SqileY8PZ6j8Y1+t53BWlke0ZwWvsOyAUlL0K8QyJ6V1aZeKp3/5IHzQ62eOHHkTz3Z 6S8X1ZfmMX9oCVDB98bh8PdhmGtnDNKIljvQI5KOU0Zlfof/9cGBBJNk72Nw/uxJXZfg 0wm5TXaIfXWpTUrtPNQzxj3I4naPdd6wTEGhV5r9CMH9g2JAD8dWNS4csatXm9pp8/1w Q51A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=hoOfl3GF; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ce12si2488111ejb.719.2020.09.29.05.18.33; Tue, 29 Sep 2020 05:18:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=hoOfl3GF; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732230AbgI2MPc (ORCPT + 99 others); Tue, 29 Sep 2020 08:15:32 -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 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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; } -- 2.25.1