[linux-next,v2,2/3] drivers/platform/x86/intel/tpmi: revise the comment of intel_vsec_add_aux
Message ID | 20230309040107.534716-3-dzm91@hust.edu.cn |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp88234wrd; Wed, 8 Mar 2023 20:22:46 -0800 (PST) X-Google-Smtp-Source: AK7set8W/AjyXVA+t7ocTBwD5OpA2uaEwRWCaWfk21w8YDCzPBqeZKagrjZ0DRUQCz4PJMBJhmnk X-Received: by 2002:a17:902:ec91:b0:19b:2332:18cb with SMTP id x17-20020a170902ec9100b0019b233218cbmr25836194plg.1.1678335766184; Wed, 08 Mar 2023 20:22:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1678335766; cv=none; d=google.com; s=arc-20160816; b=DNCRoPTHvFn4BUVmysW4PbC5cvhI8ERoO2k6A9slYu0lHgBzG5Aa+YcKSC4YHXlgCc i4RdYf/2xTvZT5n1c9RgPvOxNhTZu4EQNElBPEN5G3eBbUQbm15nKJRJeJuj+r69lYr8 Q94iLEjY5rGT7ygJwPME14ttMcCldPHtkmU7kxFuF33tlWdY9DV+UBz66dKP/O27f8Ff dMWgC4Z6qpeNBxCIGXGhEhU9kiR5RyNx15hveXOZlZD7hA80qZPHJDhPTPxvhQPoNRCm mg6R8KCMP1Lqkzu4VksdCqv7Y/VnObY0LfQzvJpPPA0HveH5won78li5Tg3oYlWvVz57 K9AQ== 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; bh=dtX/ECirPmG3UOQX7t8czU7sfmu0oPe0FSG0pwUf0C8=; b=XLYxjuZQDCJ7hXOC1oykkWlCxqpc9ZMubZoA+SEYjXNNtqubMqlwhPHa0Nte9Ksbwu nyry+CaH2MppGjwcPT0NqiFTN3q0eBLpho3LQXp0+hY+yhuZh/iPbvwa7qbQ7AzScUyL gHlfuHxTLb70H6Z6YbFii3gCBsmdDWc6LC0lgtSyUiUMDxV3U2IUo82VF0GZIxow3OxT rE8BfJ01jW8Nbysn3Xtahebnq19jm3xBX6Ou+dyDIDHBwGxhDDHleAjx1C4oq2SeMN6n BGuHFw1UgLEJVChqk54OZwwKqfEoFMv8ESENVJmWUAAibpZ+/sRnVBjFA2YeyzAoH3BY K5nw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u10-20020a170902e5ca00b0019c9648fa32si18983680plf.109.2023.03.08.20.22.33; Wed, 08 Mar 2023 20:22:46 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229965AbjCIEEW (ORCPT <rfc822;carlos.wei.hk@gmail.com> + 99 others); Wed, 8 Mar 2023 23:04:22 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33326 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229695AbjCIEER (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Wed, 8 Mar 2023 23:04:17 -0500 Received: from hust.edu.cn (mail.hust.edu.cn [202.114.0.240]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3EB1B69CD3 for <linux-kernel@vger.kernel.org>; Wed, 8 Mar 2023 20:04:15 -0800 (PST) Received: from localhost.localdomain ([172.16.0.254]) (user=dzm91@hust.edu.cn mech=LOGIN bits=0) by mx1.hust.edu.cn with ESMTP id 32943g7q028914-32943g7v028914 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Thu, 9 Mar 2023 12:03:56 +0800 From: Dongliang Mu <dzm91@hust.edu.cn> To: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>, Hans de Goede <hdegoede@redhat.com>, Mark Gross <markgross@kernel.org> Cc: Dongliang Mu <dzm91@hust.edu.cn>, platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH linux-next v2 2/3] drivers/platform/x86/intel/tpmi: revise the comment of intel_vsec_add_aux Date: Thu, 9 Mar 2023 12:01:06 +0800 Message-Id: <20230309040107.534716-3-dzm91@hust.edu.cn> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230309040107.534716-1-dzm91@hust.edu.cn> References: <20230309040107.534716-1-dzm91@hust.edu.cn> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-FEAS-AUTH-USER: dzm91@hust.edu.cn X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_PASS, SPF_PASS autolearn=ham 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1759862604372941385?= X-GMAIL-MSGID: =?utf-8?q?1759862604372941385?= |
Series |
[linux-next,v2,1/3] platform/x86/intel/tpmi: Fix double free in tpmi_create_device()
|
|
Commit Message
Dongliang Mu
March 9, 2023, 4:01 a.m. UTC
intel_vsec_add_aux() is resource managed including res and
feature_vsec_dev memory.
Fix this by revising the comment of intel_vsec_add_aux since res variable
will also be freed in the intel_vsec_add_aux.
Signed-off-by: Dongliang Mu <dzm91@hust.edu.cn>
---
drivers/platform/x86/intel/tpmi.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
Comments
Hi, On 3/9/23 05:01, Dongliang Mu wrote: > intel_vsec_add_aux() is resource managed including res and > feature_vsec_dev memory. > > Fix this by revising the comment of intel_vsec_add_aux since res variable > will also be freed in the intel_vsec_add_aux. > > Signed-off-by: Dongliang Mu <dzm91@hust.edu.cn> Thank you for your patch, I've applied this patch to my review-hans branch: https://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86.git/log/?h=review-hans Note it will show up in my review-hans branch once I've pushed my local branch there, which might take a while. Once I've run some tests on this branch the patches there will be added to the platform-drivers-x86/for-next branch and eventually will be included in the pdx86 pull-request to Linus for the next merge-window. Regards, Hans > --- > drivers/platform/x86/intel/tpmi.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/platform/x86/intel/tpmi.c b/drivers/platform/x86/intel/tpmi.c > index 882fe5e4763f..036d0e0dba19 100644 > --- a/drivers/platform/x86/intel/tpmi.c > +++ b/drivers/platform/x86/intel/tpmi.c > @@ -239,8 +239,8 @@ static int tpmi_create_device(struct intel_tpmi_info *tpmi_info, > /* > * intel_vsec_add_aux() is resource managed, no explicit > * delete is required on error or on module unload. > - * feature_vsec_dev memory is also freed as part of device > - * delete. > + * feature_vsec_dev and res memory are also freed as part of > + * device deletion. > */ > return intel_vsec_add_aux(vsec_dev->pcidev, &vsec_dev->auxdev.dev, > feature_vsec_dev, feature_id_name);
On 2023/3/20 18:33, Hans de Goede wrote: > Hi, > > On 3/9/23 05:01, Dongliang Mu wrote: >> intel_vsec_add_aux() is resource managed including res and >> feature_vsec_dev memory. >> >> Fix this by revising the comment of intel_vsec_add_aux since res variable >> will also be freed in the intel_vsec_add_aux. >> >> Signed-off-by: Dongliang Mu <dzm91@hust.edu.cn> > Thank you for your patch, I've applied this patch to my review-hans > branch: > https://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86.git/log/?h=review-hans > > Note it will show up in my review-hans branch once I've pushed my > local branch there, which might take a while. > > Once I've run some tests on this branch the patches there will be > added to the platform-drivers-x86/for-next branch and eventually > will be included in the pdx86 pull-request to Linus for the next > merge-window. > > Regards, > > Hans Thanks, Hans. Shall I send the patch related to memory leak to the mainline? The mainline is also prone to this issue? > > > >> --- >> drivers/platform/x86/intel/tpmi.c | 4 ++-- >> 1 file changed, 2 insertions(+), 2 deletions(-) >> >> diff --git a/drivers/platform/x86/intel/tpmi.c b/drivers/platform/x86/intel/tpmi.c >> index 882fe5e4763f..036d0e0dba19 100644 >> --- a/drivers/platform/x86/intel/tpmi.c >> +++ b/drivers/platform/x86/intel/tpmi.c >> @@ -239,8 +239,8 @@ static int tpmi_create_device(struct intel_tpmi_info *tpmi_info, >> /* >> * intel_vsec_add_aux() is resource managed, no explicit >> * delete is required on error or on module unload. >> - * feature_vsec_dev memory is also freed as part of device >> - * delete. >> + * feature_vsec_dev and res memory are also freed as part of >> + * device deletion. >> */ >> return intel_vsec_add_aux(vsec_dev->pcidev, &vsec_dev->auxdev.dev, >> feature_vsec_dev, feature_id_name);
Hi, On 3/20/23 11:57, Dongliang Mu wrote: > > On 2023/3/20 18:33, Hans de Goede wrote: >> Hi, >> >> On 3/9/23 05:01, Dongliang Mu wrote: >>> intel_vsec_add_aux() is resource managed including res and >>> feature_vsec_dev memory. >>> >>> Fix this by revising the comment of intel_vsec_add_aux since res variable >>> will also be freed in the intel_vsec_add_aux. >>> >>> Signed-off-by: Dongliang Mu <dzm91@hust.edu.cn> >> Thank you for your patch, I've applied this patch to my review-hans >> branch: >> https://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86.git/log/?h=review-hans >> >> Note it will show up in my review-hans branch once I've pushed my >> local branch there, which might take a while. >> >> Once I've run some tests on this branch the patches there will be >> added to the platform-drivers-x86/for-next branch and eventually >> will be included in the pdx86 pull-request to Linus for the next >> merge-window. >> >> Regards, >> >> Hans > > Thanks, Hans. > > Shall I send the patch related to memory leak to the mainline? The mainline is also prone to this issue? There is no need for this, I have just moved these from my review-hans branch to the fixes branch: https://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86.git/log/?h=fixes So these will be included in my next fixes pull-req for mainline. Regards, Hans >>> --- >>> drivers/platform/x86/intel/tpmi.c | 4 ++-- >>> 1 file changed, 2 insertions(+), 2 deletions(-) >>> >>> diff --git a/drivers/platform/x86/intel/tpmi.c b/drivers/platform/x86/intel/tpmi.c >>> index 882fe5e4763f..036d0e0dba19 100644 >>> --- a/drivers/platform/x86/intel/tpmi.c >>> +++ b/drivers/platform/x86/intel/tpmi.c >>> @@ -239,8 +239,8 @@ static int tpmi_create_device(struct intel_tpmi_info *tpmi_info, >>> /* >>> * intel_vsec_add_aux() is resource managed, no explicit >>> * delete is required on error or on module unload. >>> - * feature_vsec_dev memory is also freed as part of device >>> - * delete. >>> + * feature_vsec_dev and res memory are also freed as part of >>> + * device deletion. >>> */ >>> return intel_vsec_add_aux(vsec_dev->pcidev, &vsec_dev->auxdev.dev, >>> feature_vsec_dev, feature_id_name); >
diff --git a/drivers/platform/x86/intel/tpmi.c b/drivers/platform/x86/intel/tpmi.c index 882fe5e4763f..036d0e0dba19 100644 --- a/drivers/platform/x86/intel/tpmi.c +++ b/drivers/platform/x86/intel/tpmi.c @@ -239,8 +239,8 @@ static int tpmi_create_device(struct intel_tpmi_info *tpmi_info, /* * intel_vsec_add_aux() is resource managed, no explicit * delete is required on error or on module unload. - * feature_vsec_dev memory is also freed as part of device - * delete. + * feature_vsec_dev and res memory are also freed as part of + * device deletion. */ return intel_vsec_add_aux(vsec_dev->pcidev, &vsec_dev->auxdev.dev, feature_vsec_dev, feature_id_name);