Received: by 2002:a05:6a10:c604:0:0:0:0 with SMTP id y4csp855148pxt; Thu, 5 Aug 2021 13:27:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwtRsi7A/DHZ8xub6Bzh+lID8iaP57J5MH40VhHCsswMv+cyon4TCv5Ru6oqKkpftf6WyyA X-Received: by 2002:a05:6638:606:: with SMTP id g6mr5879364jar.126.1628195238339; Thu, 05 Aug 2021 13:27:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628195238; cv=none; d=google.com; s=arc-20160816; b=QbMDcGbPg2Yygti8QBM5lEAqqgxrqsqAOIkCH+NlstHmaeIMEk73qscNBpINj8+X67 ZfHfYTXfUfR/nnWmidJHx0pUfjnHG7jMYwal4nyKG2AJGzDZS99OKEj+dE1aio8jB2hS 9+jnb1eF/KecDScnkcUvvPndSGMUrndoqOYpVRlwBCsLPzdBJmHEb3Ncppb9mwXoeKhN 4esJlty7y2WVKPVAgHO+RKG3gJP4oC5Yk6SIwxDHS8fiD+ATwC1OQdsYRA/UUa8cjY2F YMoG2ms/tv3Vx0cvU/FF1NMquDLbOLrGF1ak8LE8qk3Wnma1osiu5nJXj0FQVQQZF229 Vjfw== 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 :message-id:date:subject:cc:to:from; bh=raE6yDb/lQS58H6GsY1+XUgWWLQETgNjaXjJFQycRqg=; b=ZX99VVLtYThN4V5uxjXX7Smh+vbEg+zAs/XKVwAVKQP8finN0Bq2ezAdHHkLfYhImr cVgvgB/ChkA1Sd7RH/Q430FsOuvZLgWx1VRZbtXdl9857WsJlGY7Ng0REGXGXG4wQpic q5Y8V3SzLFhspNEbn/7oXjmkqnuR9DaKR+lSbn2FKsM09vl8/TygGHuKScdY4jPxS5sD 6+KvwvC94wDJxaEiSVC292eHNxglg5gofoX18dKO9dhY8DBBEq4yDP1MzsZ8ytuCF2+B PoRFRQRjZN0rC5H7fmXcrk4F28ssn2MkjTQptl7TDQ6a2fI6voAH51zGFbuOQkV8sWTy woXw== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d2si6198130iow.58.2021.08.05.13.27.06; Thu, 05 Aug 2021 13:27:18 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241376AbhHEShg (ORCPT + 99 others); Thu, 5 Aug 2021 14:37:36 -0400 Received: from smtp06.smtpout.orange.fr ([80.12.242.128]:41656 "EHLO smtp.smtpout.orange.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241359AbhHEShf (ORCPT ); Thu, 5 Aug 2021 14:37:35 -0400 Received: from localhost.localdomain ([217.128.214.245]) by mwinf5d63 with ME id dudJ250055JEng903udJWQ; Thu, 05 Aug 2021 20:37:20 +0200 X-ME-Helo: localhost.localdomain X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Thu, 05 Aug 2021 20:37:20 +0200 X-ME-IP: 217.128.214.245 From: Christophe JAILLET To: alexander.deucher@amd.com, christian.koenig@amd.com, Xinhui.Pan@amd.com, airlied@linux.ie, daniel@ffwll.ch, ray.huang@amd.com, evan.quan@amd.com, Xiaojian.Du@amd.com, kevin1.wang@amd.com, Jinzhou.Su@amd.com Cc: amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Christophe JAILLET Subject: [PATCH] drm/amd/pm: Fix a memory leak in an error handling path in 'vangogh_tables_init()' Date: Thu, 5 Aug 2021 20:37:14 +0200 Message-Id: X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 'watermarks_table' must be freed instead 'clocks_table', because 'clocks_table' is known to be NULL at this point and 'watermarks_table' is never freed if the last kzalloc fails. Fixes: c98ee89736b8 ("drm/amd/pm: add the fine grain tuning function for vangogh") Signed-off-by: Christophe JAILLET --- drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c b/drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c index 335b3c70e1a7..06eea917284e 100644 --- a/drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c +++ b/drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c @@ -256,7 +256,7 @@ static int vangogh_tables_init(struct smu_context *smu) return 0; err3_out: - kfree(smu_table->clocks_table); + kfree(smu_table->watermarks_table); err2_out: kfree(smu_table->gpu_metrics_table); err1_out: -- 2.30.2