Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp144199iob; Tue, 17 May 2022 21:44:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzgnTe3/lPXBIBmjjaY3J5OLE0EugjJGd7gWYkVZIBS7NxYawZfsJ4QcDedfKvek9S62VJB X-Received: by 2002:a17:902:f60e:b0:158:5c4d:d9b0 with SMTP id n14-20020a170902f60e00b001585c4dd9b0mr25938849plg.63.1652849079830; Tue, 17 May 2022 21:44:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652849079; cv=none; d=google.com; s=arc-20160816; b=rGSP0bNj6b3N8biN3hgpd9Qsda7azxa2z9KCkX3oVq1oXPDxs8DBBngkGg1tcmv0iv kFGbYoDKD4qLTxDIK7LBNzeAXZkPQIYPCDTVhh57cDPKbJX7ne6hLmGOvFLSuEAkCuOD IWIfVs2aBWPQBPofveLogU5jmSu6cu8tMYVUBAQO0wZuMcyX+u9+efRb4SpP/kW/AL7B HAQ3qBSoqyuWMVd9gCZCxm06m0wUNIteCAP8Jiaih3DB1Dc0D4W2maV+GW5IE+enjO3O AGZ9d5YYeiJFMKCC0TQ+xmGIFwTfRehv+enzMXxFKomuE4MCbjLMQ589/h8eyCKb5gGZ lBDg== 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=5IZfdhz/4VvGttsXS64BLdybZC2nkRyX3oSeFQAvEqE=; b=j0qddxqy/88ZcX2K1FAsnnjhtL7IBHbicwZA8mzQG8lgKLn+bpzj7e+Jl+cj4yCYLM IzvVxjLSoaGY5hKdPqq1IBoMwr/coMtpzr+R17zvAnSmO3KAJTONnENy9cCH9oFA+/e6 YAhveyN1UFx0bWvKCSK5TKTmGyUyRL/xTmlvAm8gMAzgxHjvNSinhcBABT3v1mCz8wFE 5lkq+Bp7RbOQCkBKG7xklhSLH/SfGCje+5LCmnFa27vgoxwuUcmKEWbZ67clp4eTV18Z vSgkUr2GQUZeI/Q9UWX+38STrTvNiomZTT7ENccG7Hlj5o0m/HMmpdqefMMssNn+DsHp iyow== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=fw5hJjp+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1: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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id u15-20020a170902e5cf00b00153b2d16596si1476456plf.414.2022.05.17.21.44.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 May 2022 21:44:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=fw5hJjp+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1: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: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 5FD152DAA2; Tue, 17 May 2022 20:57:08 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239696AbiEQU7R (ORCPT + 99 others); Tue, 17 May 2022 16:59:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58564 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1353094AbiEQU7P (ORCPT ); Tue, 17 May 2022 16:59:15 -0400 Received: from mail-ot1-x335.google.com (mail-ot1-x335.google.com [IPv6:2607:f8b0:4864:20::335]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8CE9C52E7F for ; Tue, 17 May 2022 13:59:13 -0700 (PDT) Received: by mail-ot1-x335.google.com with SMTP id m6-20020a05683023a600b0060612720715so13009616ots.10 for ; Tue, 17 May 2022 13:59:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=5IZfdhz/4VvGttsXS64BLdybZC2nkRyX3oSeFQAvEqE=; b=fw5hJjp+KGPyBKgMxbOcgYXPvsf8UB9TzTy7q1B3qynre/0rHaTvPr3GzR3F3loFYV 4eLHycI74A0UrG26lUcGCr2JzAWvIkG6qmwEPihr9HrgaHa0Q9bzkD2iSfWk436X83gK HjALCUQe6H+56pR4hF4+y5UjMjPePBcWkxunftiQKwezsKqe0HYrFQuJrwPV7TlM/msD A29WUeZxGBFn0MUmEBstcjZDlv+G0h7JpN9KmpcVTmaetzkd9+x1aW5i0F+VNqTbyi2f bH1EjjLtegof37NIfRaBoIrPVBCteS+tUyHJBegyhPoQH5Sh40YHExE1FIy4mQx8PKrP ENcg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=5IZfdhz/4VvGttsXS64BLdybZC2nkRyX3oSeFQAvEqE=; b=JOCmRsOBxv66AAnm/UD1sbMCs63vWsg7AU7KdvXar4e8HBHOHsIyttQEp/bajJq++b CWtlVFKMKx6yzPLyg7IqTJ21qiVF6T4YY36OiOHXgN+YnSzZfwWsyTHsh3Kg1uzXHMRh Hjsg8a/d5+yoOUnp/4vNrc4IRqjoWvODqvMHEAQKZbsbJ2wo4XXVe/7hGSFbZ9JlGdfV 6K0GTyfvD3Kx86TQ942tCmSIKYgHuhBPxs6CmcAvZfXkAzgLcfzkIFgvfP7X3lUXIZ44 GDqbrAofp0FJYHDHEQj3EI5FzgA2NsP2P32SpK7W32Swrhd7F0+HPgerVneTmePuYIac BDCg== X-Gm-Message-State: AOAM530KWGPy8LRw0QHMcoUioMDo+AkVIvJbTLdlFW/UcQ3aB4vvjr7p 8OWZqh4UCCDKDNtgORVEYe4qAX9zwadf+u5qMhI= X-Received: by 2002:a9d:6543:0:b0:605:e789:271e with SMTP id q3-20020a9d6543000000b00605e789271emr9054097otl.200.1652821152948; Tue, 17 May 2022 13:59:12 -0700 (PDT) MIME-Version: 1.0 References: <20220517095746.7537-1-ruc_gongyuanjun@163.com> In-Reply-To: <20220517095746.7537-1-ruc_gongyuanjun@163.com> From: Alex Deucher Date: Tue, 17 May 2022 16:59:01 -0400 Message-ID: Subject: Re: [PATCH 1/1] drm/amd/pm: fix a potential gpu_metrics_table memory leak To: Yuanjun Gong Cc: Evan Quan , amd-gfx list , LKML Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Applied. Thanks! On Tue, May 17, 2022 at 9:13 AM Yuanjun Gong wrote: > > From: Gong Yuanjun > > gpu_metrics_table is allocated in yellow_carp_init_smc_tables() but > not freed in yellow_carp_fini_smc_tables(). > > Signed-off-by: Gong Yuanjun > --- > drivers/gpu/drm/amd/pm/swsmu/smu13/yellow_carp_ppt.c | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu13/yellow_carp_ppt.c b/drivers/gpu/drm/amd/pm/swsmu/smu13/yellow_carp_ppt.c > index e2d099409123..c66c39ccf19c 100644 > --- a/drivers/gpu/drm/amd/pm/swsmu/smu13/yellow_carp_ppt.c > +++ b/drivers/gpu/drm/amd/pm/swsmu/smu13/yellow_carp_ppt.c > @@ -190,6 +190,9 @@ static int yellow_carp_fini_smc_tables(struct smu_context *smu) > kfree(smu_table->watermarks_table); > smu_table->watermarks_table = NULL; > > + kfree(smu_table->gpu_metrics_table); > + smu_table->gpu_metrics_table = NULL; > + > return 0; > } > > -- > 2.17.1 >