Received: by 2002:a05:6358:53a8:b0:117:f937:c515 with SMTP id z40csp3665548rwe; Mon, 17 Apr 2023 01:23:31 -0700 (PDT) X-Google-Smtp-Source: AKy350aUJu+zeaUvs/oEbgE6RNcwvZQUCL9CDwQst4wpqwfunNhutDGSyC4z3DYro9lQtIylj0a0 X-Received: by 2002:a05:6a00:1307:b0:62d:cfd4:e440 with SMTP id j7-20020a056a00130700b0062dcfd4e440mr19843707pfu.8.1681719810801; Mon, 17 Apr 2023 01:23:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681719810; cv=none; d=google.com; s=arc-20160816; b=htkUH7UTwk0HqzSjL6j7zpzEvfqQZl+40AVTZAZupLjQLGQA5iLGNab5U6w57gdZxW KAEsCzFzjVxORSxhGmUM6PrLsUQj2ZVJj7yiFFtZl1oSu2z+hjGYUOWgTSZyh/noFhYn MawwbYRUuMo8jArhUOJN10Xjb4rCDSpPu1612xzxjCbeL/H6N1Dag6emdxw4DVQV9jhW sL1xUkuQqYCdHEWOnSLaNPLfCfgH980SSIhONgayewbEZnlGNCtn+U5oC8tE517tWB4c lFND2Xza9T9UG5Yb7W2JVs8UAg9qIlaQ1OL5a2eHr7ya3/ZMfFKO4NpMcz7KFn0P0dnD Aa9Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent :content-transfer-encoding:references:in-reply-to:date:cc:to:from :subject:message-id; bh=GXMQRMX6kVERCU5ri0ya4QcpwZNqjpdpdcTvMLuLrb4=; b=RGmIoPrhmY8ySVn8iySQAqBvVQmbssZpB3DoJ/SRuB+Kc4/urK8EVHUnrqkda+tuT8 J9F77xRrdNuYKWnSQMFf6qAd9JMM7ZuDVagKDDNLg7kjnwKrIIsVR1cosnlS/7fvc/AU AQ36EFwRWHQ7PnrngtnjYKvv2SoRMFHvZSElZR+4+et41wQ8E3ySfKIhJDbAtovw5qYW QanRBWy9BTR7liwVEJa0puG/+ZFXRxs1V5m+r6gz8aV3gCLtdVU0FnuJqtX/UsbXJJzr ybnBMMm1N3w/AdeSX4Y5G71cev1W1WNX1wYoPqAMRXW8p98ET5m08bvWsiqdEn6jLl69 GWzw== 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id bk13-20020a056a02028d00b0050f77f03312si11170741pgb.853.2023.04.17.01.23.19; Mon, 17 Apr 2023 01:23:30 -0700 (PDT) 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 S230416AbjDQIVm (ORCPT + 99 others); Mon, 17 Apr 2023 04:21:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37874 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230436AbjDQIVd (ORCPT ); Mon, 17 Apr 2023 04:21:33 -0400 Received: from mailgw.kylinos.cn (mailgw.kylinos.cn [124.126.103.232]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4572049D7; Mon, 17 Apr 2023 01:21:29 -0700 (PDT) X-UUID: b3eec3e8513144168bf202958215a741-20230417 X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.22,REQID:36a9524f-64dc-4f97-9eec-23d6688bce3b,IP:5,U RL:0,TC:0,Content:-5,EDM:0,RT:0,SF:-15,FILE:0,BULK:0,RULE:Release_Ham,ACTI ON:release,TS:-15 X-CID-INFO: VERSION:1.1.22,REQID:36a9524f-64dc-4f97-9eec-23d6688bce3b,IP:5,URL :0,TC:0,Content:-5,EDM:0,RT:0,SF:-15,FILE:0,BULK:0,RULE:Release_Ham,ACTION :release,TS:-15 X-CID-META: VersionHash:120426c,CLOUDID:36fa34eb-db6f-41fe-8b83-13fe7ed1ef52,B ulkID:230417162124UZBCA1A6,BulkQuantity:0,Recheck:0,SF:24|17|19|44|102,TC: nil,Content:0,EDM:-3,IP:-2,URL:0,File:nil,Bulk:nil,QS:nil,BEC:nil,COL:0,OS I:0,OSA:0,AV:0 X-CID-BVR: 0 X-CID-BAS: 0,_,0,_ X-UUID: b3eec3e8513144168bf202958215a741-20230417 X-User: zenghao@kylinos.cn Received: from [172.20.12.253] [(116.128.244.169)] by mailgw (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 1607147331; Mon, 17 Apr 2023 16:21:21 +0800 Message-ID: Subject: Re: [PATCH v2] cpupower:Fix resource leaks in sysfs_get_enabled() From: Hao Zeng To: Shuah Khan Cc: trenn@suse.com, shuah@kernel.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org Date: Mon, 17 Apr 2023 16:21:14 +0800 In-Reply-To: <4c04ae6d-f8db-0a2d-0bd5-97c4ec828a59@linuxfoundation.org> References: <20230414030830.3829332-1-zenghao@kylinos.cn> <4c04ae6d-f8db-0a2d-0bd5-97c4ec828a59@linuxfoundation.org> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: base64 User-Agent: Evolution 3.46.1-0ubuntu1 MIME-Version: 1.0 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE 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: X-Mailing-List: linux-kernel@vger.kernel.org SGkgU2h1YWggLCBUaGFua3MgdmVyeSBtdWNo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