From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtpout-02.galae.net (smtpout-02.galae.net [185.246.84.56]) (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 D228F2DCF74; Fri, 10 Jul 2026 09:13:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.246.84.56 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783674798; cv=none; b=arrAijx5YgtuOXcP+64nFiYmMTWCOB0xl177IZ0oaRfBokve8dvUgM3YvGqUWFer0lk11/0CwQoPyS/8/riEPMjz3BnSAmGRxNX6wAcjWnzzbjwBrowJis3chsrCaNMSX52Us4dk6wEWGnVrM1g/UwAlI7QSEc1uM+UErgdNNAk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783674798; c=relaxed/simple; bh=Bi7jdPhoSijk8fMT1+N9Z3GA8k77oLKhSuPKJu++n9A=; h=From:To:Cc:Subject:In-Reply-To:References:Date:Message-ID: MIME-Version:Content-Type; b=XPQ3wscEMbiPuI17xGw5L2MkDAXwnjTgF2pDi8dJ9kBImhE5RIB3Ra+iBfyEufymHcHLm/EeSBqUizhJtVrLAEou67mxI8CLkejzyoIQL1YtQ8eyXqLouXiSnNEz3mFX5AG7+QeYjwjMbkWOEwVNYpwFaSp7dKSQlDifEOJUyYc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b=aCOsNMFN; arc=none smtp.client-ip=185.246.84.56 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="aCOsNMFN" Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-02.galae.net (Postfix) with ESMTPS id 339ED1A0F2F; Fri, 10 Jul 2026 09:13:14 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id F008A60341; Fri, 10 Jul 2026 09:13:13 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 37D8211BD144F; Fri, 10 Jul 2026 11:13:03 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1783674792; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=+hnMtueO5HvdeOz/acHZQ5idFrOiiproNtY+oH5bOPM=; b=aCOsNMFNwJCz+pqwsKb34jscePr8UTAlP3OTCYZhqZDfpn5Xp2bcz7eM8z71Lebx0Y4Tbr 9MqwpZsw8MSn5iqblwJc/tvpxlE/UtDOOv5R+5abHAmfQruyPYGjXjboo8AuGUQv9XE42j 3yEYBatBS3YIbd5gQoaU80LSdTbENZ8Es1Nd9SuJTgfSEh2FxB3aeOn+IFbIEXhkF4yBpK GB84ttbxLOtTikvPShhlgJxtaUkWiucn4VMmeF9n4TUAww4qo2vvC0ZdetAdgjnSxtxzRC nDS63qfIatYMgGfnpymBc4f3YTHHeHOUcBcOfgubCit3aLNfWxAsEhKEbeGX+w== From: Miquel Raynal To: Brian Masney Cc: Michael Turquette , Stephen Boyd , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Thomas Gleixner , Olivia Mackall , Herbert Xu , Jayesh Choudhary , "David S. Miller" , Christian Marangi , Antoine Tenart , Geert Uytterhoeven , Magnus Damm , Thomas Petazzoni , Pascal EBERHARD , Wolfram Sang , linux-clk@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-crypto@vger.kernel.org, linux-renesas-soc@vger.kernel.org, Chen-Yu Tsai Subject: Re: [PATCH 06/16] clk: tests: Add clk_parse_clkspec() Kunit testing In-Reply-To: (Brian Masney's message of "Wed, 1 Apr 2026 09:55:51 -0400") References: <20260327-schneider-v7-0-rc1-crypto-v1-0-5e6ff7853994@bootlin.com> <20260327-schneider-v7-0-rc1-crypto-v1-6-5e6ff7853994@bootlin.com> <87mrzn6opj.fsf@bootlin.com> User-Agent: mu4e 1.12.7; emacs 30.2 Date: Fri, 10 Jul 2026 11:13:03 +0200 Message-ID: <87fr1ri4ww.fsf@bootlin.com> Precedence: bulk X-Mailing-List: linux-renesas-soc@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Last-TLS-Session-Version: TLSv1.3 >> >> + of_node_put(ctx->prov1_np); >> >> + of_node_put(ctx->prov2_np); >> > >> > Is there a double free of prov1_np and prov2_np? If this is dropped fr= om >> > the test exit, then they should't need to be in the ctx struct. >>=20 >> These two calls increment the refcount on the node: >> - of_find_compatible_node() >> - of_clk_add_hw_provider() >>=20 >> However this makes me realize maybe I should call of_clk_del_provider() >> in the exit() function. In any case, I believe keeping a reference over >> the nodes during the test is correct and if there is an of_node_put() >> call to remove, it should be the on in the _init(). > > Take a look at drivers/clk/clk_kunit_helpers.c. > of_clk_add_hw_provider_kunit() will call of_clk_del_provider() for you > via of_clk_del_provider_wrapper. Nice, I didn't found that helper myself. Thanks for the pointers. Thanks, Miqu=C3=A8l