Received: by 2002:ab2:6816:0:b0:1f9:5764:f03e with SMTP id t22csp2333690lqo; Mon, 20 May 2024 02:32:51 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCW2tJleLi1iJHqBMA3CgBhzyAOJSU+LDZiOwhRhWYem7D7kqSugJwjlQLnSgV5/Gh9Ee/ztELsAjqs2u2axV4oA70VcMlkgVJdjXeZvTg== X-Google-Smtp-Source: AGHT+IH7o/VqdXG8jKfAMin/TfqjlmWZxIZJ/pi3PwWTOQ/j2qQyid+UB5FE+mt84gHNxX6oMrQJ X-Received: by 2002:a17:906:5011:b0:a59:ca33:6841 with SMTP id a640c23a62f3a-a5a2d5c9fc6mr1922848666b.32.1716197571431; Mon, 20 May 2024 02:32:51 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716197571; cv=pass; d=google.com; s=arc-20160816; b=vbZoZ5JdJ985U7eORZv8L8tQHqNpmD/S6VW2vSEM5yazj+DQ4zCkhmrh/vVOFADdaP mE4NZ19wl/10L4rDOzwDAWtyPYuAwZ9EufZyKaZm7gbu8JWyiId8kgzNG/8nK3K/zLyO JtLPytuK/pmT19HYCqHlG53+HM5ogsfD0xT79DXLbwLCZuaqAA/psMQiKX1ai4e5hhtn QBcWKPPCvK9iFhbapVtKsBE1hukK9VPTh5tE84GxSghyEU0gwpohcU1kjT1r+HYJWAw5 EN7OigAEfxZ6F4gOdmOszLTPMipV8Z85vrvReOKL69VhANdtlfyNIfRCh4y8J6iCsGp3 Vt2w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=VHjDhF8zKcuH4KaZDrxu/GGnpHyFrMbNt+nqVfo/Ty0=; fh=hd4XHv404FSnnWW+iNdjaRFTkFiMcQJy6yzRx7PmItM=; b=0SUnhZEsX61khtqDg37WPkBkfCV90bibqb+MV7s/G66nPSQX/6d16uvgXOE8vf+kpK UEnDk7+IR1WwoFCBq0xM1vc8cOn8EDkOn2ii6Ao/ifoTFbG3Sej+crvdqSpvgSK0pd2x rQNmoQIGUigi8fcG5+8Lm7+Qj1uRaSPAP2nCpg4rDOW57I9Ai1u42L58pieNhBwWfdVT n6a0N+DOyltFFbUMjYB0Nm9S6pQfVDNCz/APXkfKpOnosiMqZfSZxrp4h8mRaRNykGM6 kTva/dCAJYX1fs5pDBph60VgF5To6Fg5TeABZHzD+UjivIDTbuspyx0aWiCuit9GJlkQ EZ3A==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="ABtfl/GW"; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-183541-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-183541-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id a640c23a62f3a-a5a58afaef0si969617966b.883.2024.05.20.02.32.51 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 May 2024 02:32:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-183541-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="ABtfl/GW"; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-183541-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-183541-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 2C7811F21B44 for ; Mon, 20 May 2024 09:32:51 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 62EA51CFBD; Mon, 20 May 2024 09:32:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="ABtfl/GW" Received: from mail-pf1-f174.google.com (mail-pf1-f174.google.com [209.85.210.174]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4C1871B27D for ; Mon, 20 May 2024 09:32:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.174 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716197562; cv=none; b=EH50D2KhOG+e+cCDizYvD7qLDkOHmDlGZGIF61zBon204zp6lSxcuuZNgs5RvseQ+0qFHXEN31HEyazz7WmrzAkQUlDtXusaclM5oyK7DLhGULMNGwWA1tUqZ44tfh42jmTw4aQxFUbkya/PQBFWxHka8e0K/e1eZjwp5wgV7Tg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716197562; c=relaxed/simple; bh=6qqAt+q020TEX/srbVeaNcplSl/KDDH8/TynN7XepB4=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=oKbH8p/UQJF1ApFoQE6U5b6Se1HTfHtEwIgUkyn3lwUcY6orbSYNirnt0imyqJRLuGXtcjoSSEl7LC6g6BDWM6VegKehSCdFp9m7e0yijJV9QmICUe5q2P/rfDr69SjlLK/DtFnu0lEcFGW5zlhc9h3Ud2NklyWBGBWfis4pMCM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=ABtfl/GW; arc=none smtp.client-ip=209.85.210.174 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-pf1-f174.google.com with SMTP id d2e1a72fcca58-6f67f4bebadso117188b3a.0 for ; Mon, 20 May 2024 02:32:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1716197560; x=1716802360; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=VHjDhF8zKcuH4KaZDrxu/GGnpHyFrMbNt+nqVfo/Ty0=; b=ABtfl/GWJsS2j7QFjZny3VQhxa0wIOS0fY2+8mOTZKNwQds9z7xJS4JzFEM4E2lS6w HgPdqXISwcxph5cZi9uzJQjnFdzl8G7JuRNZw80FXOXwdCCknJ5emLRovZuuvvsLJbDx 1xFW8SG5T3gswEpnt7HbtpARZSVroukH1WujziKqo2tMGMOeABgTeRShUib3kdO0Y3cV K7d0RhkEM+yFgyR5XxHozta9eC4ByBQiR04GcbB8gRJ5EzsfkeMX30dGDZ/fZ3W5Butk BhpSN92QbQgVjoMsACCJTp0ES/3tvjiBwro8ikRpytrhljVUfy2jywIbqozNPQ7FMdDQ G8nQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716197560; x=1716802360; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=VHjDhF8zKcuH4KaZDrxu/GGnpHyFrMbNt+nqVfo/Ty0=; b=cAiqGklNt8Gc3s9ZADcDpUahnam85rnQ8pMHMXQ5CouqqNrnxdkVyEF0qNpeAxtfhN qicS6d92ItL92/RzyHjlN+aix/jxzpEZOOQVhToQmLBXbc0KFed72hu0IfpGmQCAEWKZ 97MAjwLiPmyPWgXxA6rJKw/NfFXOJE5U74mDXg5gf/Ah+WTOWryRLft4f6ei5K2tFQBb z26AxrjXdY7ZxskcpGyBAqY4oubXMelIiTuunm+EOeRZcrSWATEdkfsebNiAtCJ95Uuf czR/EevOwXeEobTu/HkYXP0XG5Q+nk+zMG2ZH9sugUCxrpJhVOrNARj+59yqNEaDgrmk C5+g== X-Forwarded-Encrypted: i=1; AJvYcCULf2y/+MTv34qQmvL8jQN3WGX+nyNAi4jhUdQG5lDtZX/FDcSyqQAjtcKzp5Di5AfyxAkbGGumgX8qT757j8Yai5NOdx/x1QLvdML0 X-Gm-Message-State: AOJu0YyCmAm47p6wVraIToOYKL+rVZI6pmVq8A7gUm5g2d1JBjzqZT9O mHNTrMvvCr75mRhNfB1sIS5w7oV7Eaovw2N90cgx1e4IC9JXHEsGVtzwWyyZKR0= X-Received: by 2002:a05:6a00:3a01:b0:6ed:5f64:2ff4 with SMTP id d2e1a72fcca58-6f4e02af0d1mr31874819b3a.14.1716197560387; Mon, 20 May 2024 02:32:40 -0700 (PDT) Received: from localhost ([122.172.82.13]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-65e149dd925sm5500703a12.58.2024.05.20.02.32.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 May 2024 02:32:39 -0700 (PDT) Date: Mon, 20 May 2024 15:02:37 +0530 From: Viresh Kumar To: Javier Carrasco Cc: Yangtao Li , "Rafael J. Wysocki" , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland , Andre Przywara , Jonathan Cameron , linux-pm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-kernel@vger.kernel.org Subject: Re: [PATCH 0/2] cpufreq: sun50i: fix memory leak and remove of_node_put() Message-ID: <20240520093237.fucml6sp2ziygyav@vireshk-i7> References: <20240503-sun50i-cpufreq-nvmem-cleanup-v1-0-0a2352cac46b@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240503-sun50i-cpufreq-nvmem-cleanup-v1-0-0a2352cac46b@gmail.com> On 03-05-24, 19:52, Javier Carrasco wrote: > This series fixes a memory leak by means of the _scoped version of the > for_each_child_of_node() loop, which was recently introduced with > 34af4554fb0c ("of: Introduce for_each_*_child_of_node_scoped() to > automate of_node_put() handling"). > > The new approach is still not widely used, but this might be a good > occasion to use it in a driver because it actually fixes a bug, and > the loop is rather simple. > > The creator of the new macro was added to the discussion in case the > new approach is still not mature enough, even for such simple case. > > Additionally, the existing uses of of_node_put() have been removed to > favour the _free() cleanup handler, which reduces the chances of having > any other memory leak because some of_node_put() is missing as well as > simplifies the current code. > > I don't have the real hardware to test the series, so I "faked" the node > in a device tree for an arm64 device (Rockchip) and hacked the driver > to get to run dt_has_supported_hw(). The new implementation works as > expected, but if someone wants to test it with the proper SoC, > additional tests are always welcome. The same applies for the removals > of of_node_put(). > > Signed-off-by: Javier Carrasco > --- > Javier Carrasco (2): > cpufreq: sun50i: fix memory leak in dt_has_supported_hw() > cpufreq: sun50i: replace of_node_put() with automatic cleanup handler Applied. Thanks. -- viresh