From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 293D4405C21 for ; Mon, 15 Jun 2026 17:18:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781543894; cv=none; b=XAU0328JW72kZMwLiHGEtcg+hdlxHT+k1h8L9w7cHHQHKU4+wh7UWRvV9FeyER9v62zGdHd0ZfYjE4DDsIIWbJ+AdHp1NZTzsLZc7G+AEcGyevrEM2MEZReROWBpWZ3kE/Zn2TKtX/hpqcKK3QHHAtZYshpyXSofEFVAIiyvmi4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781543894; c=relaxed/simple; bh=6MjK4Ekl6EgbuHurjrLkCh0S8WdwZwdwkLo1uggeUk0=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=sVYBEwHcXGWoWj5owLzSh1gbV599tZ51NA4ZbcapD3HPMOqelhOOAP4jErGlFm+SLXS2XNHb7YhzRKKzoHuA5Rp85x5Y5+aV7Qd9Rwoc/qHfVk+Uv+cYdWitztamyLToZ3hNMITyiLcNW+U5Q8KzBhI0LsHb2aSagUJ+1Tc3VtQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=hjEEIeAe; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.b=YgyBCN8r; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="hjEEIeAe"; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.b="YgyBCN8r" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1781543891; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=oZr+ycgvZUilxhhoW/bzv6nOUngq3yd4joV7dFf5q7I=; b=hjEEIeAeJim4/+7RWdVMN0u9XN07KW8mgqBuEHtQkSO6shWtkvBue+YBmUuBiWIQGC9f8Y zMmcjAoKr/cCfHUb3bfbyVE3ULBBHw+H4Mhc8Fe3t8VN4Vj3QckRWmeo/wU8TEgWqCL3wi 3n2TSRaYTMaHxboQKBK+FZRzN8xODww= Received: from mail-qt1-f197.google.com (mail-qt1-f197.google.com [209.85.160.197]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-277-cWTvlNEYOYy_RHsuxgPqTg-1; Mon, 15 Jun 2026 13:18:10 -0400 X-MC-Unique: cWTvlNEYOYy_RHsuxgPqTg-1 X-Mimecast-MFC-AGG-ID: cWTvlNEYOYy_RHsuxgPqTg_1781543889 Received: by mail-qt1-f197.google.com with SMTP id d75a77b69052e-5175b7946d5so29146041cf.0 for ; Mon, 15 Jun 2026 10:18:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=google; t=1781543889; x=1782148689; darn=vger.kernel.org; h=user-agent: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=oZr+ycgvZUilxhhoW/bzv6nOUngq3yd4joV7dFf5q7I=; b=YgyBCN8r3zHMlSL/SJ+pyavqbBJ9A1fxcVUkyrUzNxgEn8IoMqas5GxhTlryBLY8W4 qQR+cwpgqHqPz9EBpOkxH/AvtrJ8OOHvMORiKNJIECXd6HMIFA9uk42cRP7/ybQT6jbh hewMQFmSDFE+l68yKEc7C0lbibXaW9Nyo+FMkxSDMvaIMvukFIuT6G/E2i0OA1doBDnW Tqvz+rGnOYd8dVHG0sU2spi4/23ZXGKI5xooSjCTXF4VI4ZEseD2VXqmwz8I3FDLcO1e 7eS41HkBKXfKUns3g72Sf6/VsiRYWXvGFQz1gGjke60gN2ANEhXUd1Bf573GOYWO7Uzt TJCQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1781543889; x=1782148689; h=user-agent:in-reply-to:content-disposition:mime-version:references :message-id:subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=oZr+ycgvZUilxhhoW/bzv6nOUngq3yd4joV7dFf5q7I=; b=nTFLtbvJav/aW+4jrpWWEACnFHJaOkvtZxWMvhD98I0Y4R+HzYSmBBIIJfDSuHBhss /NJKtELoq9NI9av/6ifL5yw9Zm3w9NnRb+d/8609J4qMTjc9EaewPmvbtrcpusNENRVh Z7nMyccXIK42ZtJLtnhg4mc2GgwwyuRlfrsuhNi/ki5UpG3lEsYNGUt8jk6N1h4f7eFs RhUIA7za8yk9DWLElpURWFFAOnRcClsQR405aBSFg/v4sUBemaneLUhXDLRHsfiantw4 zAx7XvziXKqW8DW+ChclA+YhaZZlp/fgECnYFNE+Oh2atK5loRLhANmv5RP6xFr40zg1 GWjA== X-Forwarded-Encrypted: i=1; AFNElJ/QyOREvAoPYlSYaGvo5svEsuqujXvtIf4uKjIQaUpEmTVmO5SpF6Sfa3OFDv7Q8hjCMrI2a3vKARoPQEw=@vger.kernel.org X-Gm-Message-State: AOJu0YyCfp/jOovqVFggNVBuC6tlzwHFyk9TZ6OlZpemRwh5nRrwyAD+ uUifyVe4uVI51n9pY1SbVCEeGON9d4BtWrTAd8jIRxLj1uDp7wswmH1Mi0VlG5kEV+o0QGqx8+o J80hr4dsMdNOMz5J/90QykppMpV8QqPJx1+jeeyibwxxi9e0e2nJsmqjrvKKJAkE+rA== X-Gm-Gg: Acq92OHZZTLL0/Tky9+uT2KXIc/NWs3KmEPeljB/UoQk3GFiQHJLSURdLohrrEOGCr1 uT6b7WwvlwZldwkAFMa8PPT7vydHrqdIWjUZb+Khr2eeN6FCcVEGhU/3FZjcnberLyIW7K2V8Yl VN5hoonviu3yGqwqo2aIx2phjAVtKvytpqd5HZo1qnc1VmSW0brpWG1ENTuOTR459HG3AHGCrxW DafVT5+YTwzm5l8uwlWO2Hc6a+Bi/wNST+yb2RYD9zYDOaPN2GDlEG0RodxhECHK4YI7qrDkqqX 1/uCvILAILagec06VqgjPLdz03RXmUZe3uL6ysdE4eXg/faVbnEokFa/PDwBI5UNtZjAht2Yxts ipWWAU8iQuf5XLjrnVwiPp+CYstYqn6pCOET98Zd3Gq1YLiCxUN/mVHbM X-Received: by 2002:ac8:5e11:0:b0:517:9206:10fd with SMTP id d75a77b69052e-517fe4f99aemr224740461cf.16.1781543889146; Mon, 15 Jun 2026 10:18:09 -0700 (PDT) X-Received: by 2002:ac8:5e11:0:b0:517:9206:10fd with SMTP id d75a77b69052e-517fe4f99aemr224739901cf.16.1781543888617; Mon, 15 Jun 2026 10:18:08 -0700 (PDT) Received: from redhat.com (c-73-183-52-120.hsd1.pa.comcast.net. [73.183.52.120]) by smtp.gmail.com with ESMTPSA id d75a77b69052e-517fb7a2227sm111888521cf.16.2026.06.15.10.18.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Jun 2026 10:18:07 -0700 (PDT) Date: Mon, 15 Jun 2026 13:18:05 -0400 From: Brian Masney To: Wentao Liang Cc: andrew@lunn.ch, gregory.clement@bootlin.com, sebastian.hesselbarth@gmail.com, mturquette@baylibre.com, sboyd@kernel.org, linux-arm-kernel@lists.infradead.org, linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org Subject: Re: [PATCH] clk: mvebu: ap-cpu: fix missing clk_put() in ap_cpu_clock_probe() Message-ID: References: <20260604025115.3763823-1-vulab@iscas.ac.cn> 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: <20260604025115.3763823-1-vulab@iscas.ac.cn> User-Agent: Mutt/2.3.1 (2026-03-20) On Thu, Jun 04, 2026 at 02:51:15AM +0000, Wentao Liang wrote: > The function ap_cpu_clock_probe() calls of_clk_get() to obtain a > reference to the parent clock for each CPU cluster, but it never > releases it with clk_put(). The returned clk is used only to read > the parent's name via __clk_get_name(), and the reference is leaked > on every successful cluster initialization as well as on the error > path when devm_clk_hw_register() fails. > > Add the missing clk_put() after the name has been extracted and > before returning on error to fix the leak. > > Fixes: af9617b419f7 ("clk: mvebu: ap-cpu-clk: Fix a memory leak in error handling paths") > Cc: stable@vger.kernel.org > Signed-off-by: Wentao Liang This calls: parent = of_clk_get(np, cluster_index); if (IS_ERR(parent)) { ... } parent_name = __clk_get_name(parent); Can this all be replaced with a call to of_clk_get_parent_name() ? Brian