Received: by 2002:a05:6a10:c604:0:0:0:0 with SMTP id y4csp891231pxt; Thu, 5 Aug 2021 14:28:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw8cZibjadur0XFe2s8UKmkYvzw25YYlnOguX/MKQK71dgIe5pP63LnuOuPcB3dvqZlQGQi X-Received: by 2002:a17:906:1f82:: with SMTP id t2mr6592872ejr.499.1628198933036; Thu, 05 Aug 2021 14:28:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628198933; cv=none; d=google.com; s=arc-20160816; b=aEe0k39xCQaHWXVwxubhXlP8gMj4WX60xh9yFIMaKKwZC3Wb8F/SkSzVoz/DwyaMZw 7VtwosB8GN+0FJuDw6QxwmSRahuKVdoroPvgl9IcVxYHSpOIGmpl2ytkT33lEq0KIxt+ cNT6Ee9GwivjL2Cd1wwCm4b4XJHDURrbDPMZcywFYh7l7gUtdDRMNIoS9AB2LW219n6Y ekpO31HjSTS7Iq17t/RIuDwjLJzydNLaLauhOK0wEQZuvgZN/mcLXlISd53+kI2cLU5s IM3bVu3YUzeHWQ4emNGQhIBmdKUpuJP+G6LWGIABZRGg22FWdagyv8/ffA/rKnYj7eYl VPrw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=oqhS5sUxb+FPRaCHmEWlXq3OvfKWMu7XyfbVn+a5nZ0=; b=eE4og8xVyaVagzD4sFFrXZPlu4qnrk/uTAcLmP4NbzdWHa/LrkZDGhmDkn938jmxAd m3nPc5sh+cCuMkLVPUwdKiQB/5YO+tkTh7BFqyhWh4AmDb8bHS8ikZq0d58hnfBIk8B9 qhgpGzasNTQeCUW7+RCgHJQ2AxiQI0HsyKgLl+ogzmzFkL1CWv8aVO5/UPjTSHlBdFSo EiztxGOrTfvozhN9wnzBvbn7ojGrpinIDOUVsNCwl2uSqGsRSPqUZeyU9NSgq6xHQY87 5TZIRunqK+CrwRNJnl3EiFEEoLOMWWlRxVbZu4Q1CjiGzFR6EMtbdNvdddU0LRkbAdR3 EGxA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=ofpTRUJc; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id qb42si3331850ejc.536.2021.08.05.14.28.27; Thu, 05 Aug 2021 14:28:53 -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=@gmail.com header.s=20161025 header.b=ofpTRUJc; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239108AbhHETp4 (ORCPT + 99 others); Thu, 5 Aug 2021 15:45:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59470 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239020AbhHETpx (ORCPT ); Thu, 5 Aug 2021 15:45:53 -0400 Received: from mail-oi1-x233.google.com (mail-oi1-x233.google.com [IPv6:2607:f8b0:4864:20::233]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 54E87C061765; Thu, 5 Aug 2021 12:45:39 -0700 (PDT) Received: by mail-oi1-x233.google.com with SMTP id y18so8887126oiv.3; Thu, 05 Aug 2021 12:45:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=oqhS5sUxb+FPRaCHmEWlXq3OvfKWMu7XyfbVn+a5nZ0=; b=ofpTRUJcKmfmo43OyrJS4dZ5vMxWnnJ0cbyaTvQzR9uVGmEcyeB0XNSK/Xj+HZP1uQ iJZPQdwsWTRpdZ/yllLQhRQeUCaShZrke6Eu3N7VECTgzErEupVOCkWFIO/d5tN0FiWL JZ87mc5Y9d/gPNfVxe05qY84BGaAbtfO8tQ6SzaMzoGLKwN53MBFeuhTjX4KsE+OSv36 X1Z0nHMsUdFyHWZ0UkC6SVY0kLa1lFz85NXBSp57KBgJse2ReaW6jVuRzkrQJcvC0yJk Rm65oqHcuWn8yy8MtXEANt+7U3hdIwM7kWvXa7AS2P7aninDFW1MyHZSqSZw4lvIGlRD tMHA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=oqhS5sUxb+FPRaCHmEWlXq3OvfKWMu7XyfbVn+a5nZ0=; b=H8KV1P0/qu6OcmimGIJb0EkQQGQCvJHSJYS1VWq0gz0SiaNHR3z1x3oLwM5DOrWpYv g+1V4rjB+DETFUbQvasIbKZ3eexNjGVw0yRbN7D+jFTf8M7kl9KqrRLNaDqvaBCmCw3p oDGK4CVrv4Q+dd/+ZkDKppOVRfdNNypHXK8tzCvDkKou9GP1mypR0hcOo40Aa0c2+3T4 W/YW5bNrH59jpoJjChd2QIREQCmnpMffkwXyWVWDYlkxJ7DDGLnKo3S/5fH9PcfwvWaP Sppa9M8o0rn5PLd2Yuc3opNn96MoymPjuzuFdnXUCGKwfKNQreIRa/+qRXMcFIMu5cLu yeSA== X-Gm-Message-State: AOAM530rcRM9seXBo5FGLke7Yj2h9LiaQ39uV+tdIJyZyi2dtKqxpeIi 8DpimO1vQ7xe78n0Il3ZLjJTDe2XeloRpFYCSIo= X-Received: by 2002:a05:6808:6d2:: with SMTP id m18mr4805541oih.120.1628192738822; Thu, 05 Aug 2021 12:45:38 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Alex Deucher Date: Thu, 5 Aug 2021 15:45:27 -0400 Message-ID: Subject: Re: [PATCH] drm/amd/pm: Fix a memory leak in an error handling path in 'vangogh_tables_init()' To: Christophe JAILLET Cc: "Deucher, Alexander" , Christian Koenig , xinhui pan , Dave Airlie , Daniel Vetter , Huang Rui , "Quan, Evan" , Xiaojian Du , Kevin Wang , "Su, Jinzhou (Joe)" , amd-gfx list , Maling list - DRI developers , LKML , kernel-janitors@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Applied. Thanks! Alex On Thu, Aug 5, 2021 at 2:44 PM Christophe JAILLET wrote: > > '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 >