Received: by 2002:a05:6358:53a8:b0:117:f937:c515 with SMTP id z40csp4793135rwe; Mon, 17 Apr 2023 19:33:26 -0700 (PDT) X-Google-Smtp-Source: AKy350bx6L66ai5v96XLVbFethzJKHUp8Qdk12Xi0bIy/glOUIVkLxflbA4firRKwEEXJhsu1HJR X-Received: by 2002:a17:902:8601:b0:1a6:c72e:79f2 with SMTP id f1-20020a170902860100b001a6c72e79f2mr596546plo.42.1681785205761; Mon, 17 Apr 2023 19:33:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681785205; cv=none; d=google.com; s=arc-20160816; b=zlmXQOaUTqc35Eng1xCFfCCTOrjNaVuxdvFFpfa93guukahgssH0YvkX5svNG64uOe RKUSf4F5wPKab2k9B543rgqEvsGg5ShovLCINcyIrRKQhVo1T+nMxulFgYSGBXLOZHLu hxL41lZ3rZ4rkS7i+Yf7t3PLu8+aVXV3vYiDq3LrMdp847bk7O1Hof8bT3gLx0FQ04PQ HtGk25ipl9G+r4K5uqe/oF6b7SWuWAt8smOM4TMCxfGTRJURN4MyXNKAZFvSMjd1Mv/X M1kyXVIqqV4DY8D8bt+4Qk4ZjdgptfJCyI5AokbeaemJUaQN2Re7hufIGqfP39Io0qYM 6Hww== 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=n47QTIGJqAvRiokEXbR0Z6MLqV9wck66ZljtoDU/Bdk=; b=A8tLdQ2yshmvGuc3wlyWJNnLbzPwAibMtuQmuKwmD8TU5xc+xyUOL4+ME145ME/Ht7 vHZVExwuhfk+o4Sx/bBHvCdir7OYyzhPe5NnwieyqeLUCIJt9cnmnrOHjv6TH+O1CQf1 Dy2+jGL7ijB72AlgpGahyuWD4QHYYg7JO9hSj4fZaW29TBD4IishPXLJ7AQOjEoT6+hw pBWDhe/WVXaAIsH4Ak7EFB0NZ1wJsjcuJo/q2Za/IuA2L0DiiGGQX3lXnmzZ1Wt4q1Ps 0mLr9mA3XiB6ACSavBTVHKZEJ1G/Nu2WRC57pBXvmQP21gs0+EINB/kyv+hHaYW6toXn 6JKg== 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 q18-20020a170902dad200b0019a59c52fd3si13798155plx.508.2023.04.17.19.33.11; Mon, 17 Apr 2023 19:33:25 -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 S231151AbjDRCVe (ORCPT + 99 others); Mon, 17 Apr 2023 22:21:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57606 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229621AbjDRCVd (ORCPT ); Mon, 17 Apr 2023 22:21:33 -0400 Received: from mailgw.kylinos.cn (mailgw.kylinos.cn [124.126.103.232]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8B828A7; Mon, 17 Apr 2023 19:21:31 -0700 (PDT) X-UUID: fd0f252e83574171aca8818452e12339-20230418 X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.22,REQID:d3425583-a400-4281-87c0-1e7fccebb94d,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:d3425583-a400-4281-87c0-1e7fccebb94d,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:5b74a9a1-8fcb-430b-954a-ba3f00fa94a5,B ulkID:230418050923GEA6D6HB,BulkQuantity:3,Recheck:0,SF:24|17|19|44|102,TC: nil,Content:0,EDM:-3,IP:-2,URL:0,File:nil,Bulk:40,QS:nil,BEC:nil,COL:0,OSI :0,OSA:0,AV:0 X-CID-BVR: 0 X-CID-BAS: 0,_,0,_ X-UUID: fd0f252e83574171aca8818452e12339-20230418 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 1259229817; Tue, 18 Apr 2023 10:21:26 +0800 Message-ID: <09de34cfd7aec323e3841446c1bf41749909cf58.camel@kylinos.cn> Subject: Re: [PATCH v3] 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: Tue, 18 Apr 2023 10:21:09 +0800 In-Reply-To: <4eaae372-c312-6a77-f57f-dffc5f9aff02@linuxfoundation.org> References: <20230417075617.10487-1-zenghao@kylinos.cn> <4eaae372-c312-6a77-f57f-dffc5f9aff02@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 RGVhciBTaHVhaD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