Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp883644pxk; Thu, 17 Sep 2020 20:17:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzSPiKW8MSe8eHkaxyibwk2p2TH8jQT4yD+N8wxEoHUCjiuMcpaiYzi5X3K9umVgV3dN+7f X-Received: by 2002:a50:fb18:: with SMTP id d24mr36454038edq.149.1600399023968; Thu, 17 Sep 2020 20:17:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600399023; cv=none; d=google.com; s=arc-20160816; b=anKf9WyNVWVxB7n9hwjMLngBljp99P4yHZgboZIWQ6FH9k1fCtzFe76igjLTVH/C1H 50AjFIPfEjx8boAajlcWMoBISSNGrmPr5R5Yxern78Lj+uOcrDsHj30s9RrlTzPQT0Jf J3VmPLPya5mZ1w33z38KwYMYYvkNKU1yTyS3qSg1ulDy7VhjR++j6N/awEpX+zrL2Z6f aYFhkS/KgvenW120eMFhwLgfWLZ29MjzJoWNr+2q2niNoRmXjmCK6IOzwjUWIBFE4lvK pF3WXWbkOSenIwBDnTBJvYcJkkqI6O+UrM72Cvylx+HuE5lzIozRRVmFCYonlDQLu+AC fO4w== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=CGgsXuLu0+T3PJrPZExWBcw4+VO/sWRQqOnio97xbe8=; b=Akm39aku5SaAHDCGB1SJLcOplrnwKRPL94NH5AjHAZUHM8CRI/W/Cu+zqNOcE4oY1Y r9UjKD4Hb0gEky0aVyJvygMo3UrPatOxTm7+bUz8lSWn+Q0B56lksGrUca621oDhuF/6 RvxNWvBeliH2tAZOb3GAF36nAc7xJu7AT2UqfVf33jFqNeyAgdER5UVyK0o6Rar+tEdF SDOCwY1wQ83DSOnuv99/hbka388gYQIelzOvta3SRfZVa1pX3KP2s/Zu+rq4TjDwnDWP IGFQYIy3q2rec9AGg7TqGNbNY0m3qQIt12EkSVsMqP97e6J+kOVoyWlzELuFcH6SAyH4 mhJw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=IvLVT3Is; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v11si1273269ede.8.2020.09.17.20.16.40; Thu, 17 Sep 2020 20:17:03 -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=IvLVT3Is; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730744AbgIRDO2 (ORCPT + 99 others); Thu, 17 Sep 2020 23:14:28 -0400 Received: from mail.kernel.org ([198.145.29.99]:45804 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726149AbgIRCBo (ORCPT ); Thu, 17 Sep 2020 22:01:44 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id D006D2344C; Fri, 18 Sep 2020 02:01:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600394497; bh=mqHT6RbFDr81GU1HO9Nq0bacZnanhKGb6BtrvhIrp9c=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=IvLVT3Is1yc1uTUZ8/vrMTA7IRTAd6Ab2kOWqZI0YK5ba0ggEZTrJ08K5/Bcu3vNj f4gsVudJ/r4YCU/YiM1lCkC4fhjyl0N5gx5voOxl8cNi3eM6l2An1z4C4hABV+fPV1 DojRC0NPKS4taOOklyCy47CozFcZBcC3ogHzNRig= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Nicholas Kazlauskas , Leo Li , Alex Deucher , Sasha Levin , dri-devel@lists.freedesktop.org Subject: [PATCH AUTOSEL 5.4 022/330] drm/amd/display: Free gamma after calculating legacy transfer function Date: Thu, 17 Sep 2020 21:56:02 -0400 Message-Id: <20200918020110.2063155-22-sashal@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200918020110.2063155-1-sashal@kernel.org> References: <20200918020110.2063155-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore 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