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.133.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 C5BC543712A for ; Wed, 8 Jul 2026 16:41:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783528920; cv=none; b=WzxedribcEGS36qZtOtgG/YgmHA2GjA9KNEpnVUKxAIrVBd/gPALD5PqicrS0/+lQjEIfWVA6rth1dJuSNYSdy9+/HmCUUMXDY2kFAbJptpz9IMmnsF+hyZDvGrzOd8AHXIKjPo5BigH18Ma9dUROx6jxBIHRNMIxmE90bupkI8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783528920; c=relaxed/simple; bh=hxJeTTJpCgngpttgBKLmH7ptP6ELM2r7kNGcEsfXpko=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=ODa8Zq/A9g4NjF5i1cIyCuiWbcg4ZRQ3U7yxcM/o/0UMOgQRiyijIoSiyKTifMY7JH8C6eO2wPQDeKP0azwY3MPTuiBS+Oas2qx95ZFVazAiKrTSQrlAS+8g4FZT3cYY7W0747omaeCHxnaXtAYn6Zz4g+vjipbRCW71n2WqyMs= 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=SbCly8Jc; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.b=klTcNqng; arc=none smtp.client-ip=170.10.133.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="SbCly8Jc"; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.b="klTcNqng" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1783528912; 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=KeN+eUGcS7y43ntst2e5pfjhEcVMN4wZLhE8yfU/Pkc=; b=SbCly8Jcz7CsAGIkkhNDDOYapG4eKnngeTw1HENSCWE/nO2SFisGsPeorTWdC9uiV+kIZy RcWVAwp3kxCmgOuohF75S771E/X+RfgSkhzGeybMFm+LRbLjKmHo4R9ZbNl9pG8wYJbMjU qnJg31weL8foaouLJtCza2a13/CU5x0= Received: from mail-qv1-f71.google.com (mail-qv1-f71.google.com [209.85.219.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-648-guhIc-TbPheDzo64ersIFw-1; Wed, 08 Jul 2026 12:41:51 -0400 X-MC-Unique: guhIc-TbPheDzo64ersIFw-1 X-Mimecast-MFC-AGG-ID: guhIc-TbPheDzo64ersIFw_1783528911 Received: by mail-qv1-f71.google.com with SMTP id 6a1803df08f44-8f39a46efd9so409226d6.1 for ; Wed, 08 Jul 2026 09:41:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=google; t=1783528911; x=1784133711; darn=vger.kernel.org; h=user-agent:in-reply-to:content-disposition:content-type :mime-version:references:message-id:subject:cc:to:from:date:from:to :cc:subject:date:message-id:reply-to:content-type; bh=KeN+eUGcS7y43ntst2e5pfjhEcVMN4wZLhE8yfU/Pkc=; b=klTcNqng2n3y589/zhRXCK9iucBkPG1i/Gos/foP6On4pSkdRuMZTY2acTb7lFQrKW Xcb+x1zRSKoth2qwBRsQ+xnyEOLqoOd5pIDKPY+cHJoFq35FKCl0/DNFNFXaySWMwnxh 1eN8nZD/3UZH4Yyhv+bzvuukTvm0xetO2KpdINBQ5WmfSd+9ymzqHC5cu1y+GF8pXFh1 Ua0b7kY47FEzZgV929s1EGqGPMCWLmY8DmYQGW/6Dk2ia2Gn7lEm1BeJY3XrsZeKp9Bi oSplTPy1obMOiZMg80LFMfvPWtdpnuIQQ7M9LsHACM4ibvXYV8m2aplVSRPniT3d+W6T KBtQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1783528911; x=1784133711; h=user-agent:in-reply-to:content-disposition:content-type :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 :content-type; bh=KeN+eUGcS7y43ntst2e5pfjhEcVMN4wZLhE8yfU/Pkc=; b=HHl9aBG4XLg5X39eAjzjHrwI6U9FAfdHROmNzEq62MdrFud1kFwtnE0K02cuXbujxl qXv6I0iWJTSZXUHEzJJJ+TwlmMuhReFB1ERFxZ6PIWkpos1QNISybm+2JXNrNo8vqVlF 6jYgl/AiIwzNnA9f73YGBRIoVe8aqgyH8NvVmnGCZ1vafrMbv44XraIwHP5Q0e3JTN7I H9i5fAGM5XgkDjgcHFzib+W+QHgu9ADyVXPuWLpIJpRFJDmGv+8XbYVNNsGBidk0yKDZ gL9IleddEXtCtOlA3ZXwOQx69BXcRNHhdtk1NuRdFHNAPOZfDPb5VHlyUbLpH7BHns3q +tkA== X-Forwarded-Encrypted: i=1; AHgh+Rr3g4uz06ri66IXH6RzM14Qd/V/X8/egzxkybB9uiO6klHpJFtjfvbDWunujT+GPhfn7J9Ui0TInNXWK1E=@vger.kernel.org X-Gm-Message-State: AOJu0YwYRrWxMxJw6TsxOFOhYWypGO59jry0TsbPDHMjH77eEHUYBiH0 BHNm/i1dEkcVRdbJbKss4ncjcge9RZ7vZIJOLWPe4YOy69yO7+Yp/A7W+ZB4hSTZOfeIBQys7Gl EA+Fs+tWSScAYfRyLouTyjJteaxHhIExF5h+W/ByFJrEYqydv68tZwPLtfRFLTjUwkw== X-Gm-Gg: AfdE7cl7ur3M+A97THGjVjY8FcqH5fuFpaCzPkybomFjnq9HmfPrFtQNLb/yq6Ff/IU +R63H80aWBzOVeL/sPGT6GRhLxp/835bQlM4okU8u+g23h/zRy5eGRkhwv3H8Nf+4g06SuoimWO 2JKmajJ/QunxqrNASb8j/8icIvXY7laz4FA7y9K/BJA54GI+mZrdEPS50h/VJVWMOWhSoKKb/zC 3+qKDKXpMMHR1Sl79b3umYvcvTFih3tHaimWasZhyRikwjQ1FgzXgGy3RNS6Khb7Xn/Rsv0n09S WlxMeg88iosU3MRX+bzI/I3pW4EEOD+h21qZE53M/mpW+BCtAhu0+LpcQq7ipoglRHEcKQzjr5d jgVgI5C/7L3g7V2sCdtiVNPet+fQMEoINj4S5I5iXDktMPA== X-Received: by 2002:a05:622a:4cb:b0:517:f9cc:1fb2 with SMTP id d75a77b69052e-51c8b30e312mr36983731cf.19.1783528910854; Wed, 08 Jul 2026 09:41:50 -0700 (PDT) X-Received: by 2002:a05:622a:4cb:b0:517:f9cc:1fb2 with SMTP id d75a77b69052e-51c8b30e312mr36983291cf.19.1783528910398; Wed, 08 Jul 2026 09:41:50 -0700 (PDT) Received: from redhat.com (c-73-183-53-213.hsd1.pa.comcast.net. [73.183.53.213]) by smtp.gmail.com with ESMTPSA id d75a77b69052e-51c41b55495sm147695021cf.11.2026.07.08.09.41.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Jul 2026 09:41:49 -0700 (PDT) Date: Wed, 8 Jul 2026 12:41:47 -0400 From: Brian Masney To: Guangshuo Li Cc: Prashant Gaikwad , Michael Turquette , Stephen Boyd , Thierry Reding , Jonathan Hunter , Mikko Perttunen , Tomeu Vizoso , linux-clk@vger.kernel.org, linux-tegra@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] clk: tegra: tegra124-emc: put EMC node on register failure Message-ID: References: <20260708112058.750952-1-lgs201920130244@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: <20260708112058.750952-1-lgs201920130244@gmail.com> User-Agent: Mutt/2.3.2 (2026-04-26) On Wed, Jul 08, 2026 at 07:20:58PM +0800, Guangshuo Li wrote: > tegra124_clk_register_emc() stores a device node reference returned by > of_parse_phandle() in tegra->emc_node. > > If clk_register() fails, the function returns an error before that > reference can be consumed and released by the normal runtime path. The > tegra_clk_emc object is freed on this failure path, but freeing the > object does not drop the OF node reference stored in it. > > Drop the EMC node reference before freeing the tegra_clk_emc object. > of_node_put() is safe for a NULL node, so this also covers the case where > the phandle is absent. > > Fixes: 2db04f16b589 ("clk: tegra: Add EMC clock driver") > Signed-off-by: Guangshuo Li Reviewed-by: Brian Masney