From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 0CE1E2FD665; Mon, 3 Nov 2025 10:29:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762165755; cv=none; b=RwCxBqQeZ4mPEvrtxB46tWgK29aKFaxW+Nk0dJP00PMw6aNN8teOqHoBbdndRmfCTFIk8MtwFw6vrmO/FO+PK7KQePolN9fmKjoXN3lObvNpbBTXYgYkIO2Rzq8g3cgN2cQ3XmWobJ+oJ7bo577O4jgB3cxFsYm0t1X0z4IQQ5Q= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762165755; c=relaxed/simple; bh=Nbx4jNGtndYSzelN2f3hPMbPkOF9Gg5x+1ly90843YQ=; h=Message-ID:Date:MIME-Version:From:Subject:To:Cc:References: In-Reply-To:Content-Type; b=DzzYtmNoUb6/8h+vqYQTQ7pWv4vgsPSjpdDOGiiNA7DlrBMDfxKqvMPgyZkqdmPhuNN1GUQZl7Zlt1C5GrqjlUnVW+YzH8WCrlXm7EjKpN6dFo63PIBwS6Wc0fnn8rPTfWhkWlQG7d7XWS79R/fE6hhV2Cj/Afrt3VELG7u84Sc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=udK4TPwN; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="udK4TPwN" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0EBADC4CEFD; Mon, 3 Nov 2025 10:29:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1762165754; bh=Nbx4jNGtndYSzelN2f3hPMbPkOF9Gg5x+1ly90843YQ=; h=Date:From:Subject:To:Cc:References:In-Reply-To:From; b=udK4TPwN/ksIoBwdrHsqjQELjlcpcINFzrOi5uYABT4QycI3hkBmkBKKDFldffJl/ p9dqOW/eLy2VJL19H9izAY1gnXPxW4UAq1tBuSTqt8oAT74ZByXDFi4BzoGiGrtVc4 Vk7MUuIIMhxDSbNRnBXi/n4U2jdZY1S4f+1HzyajJVK3ZD5ZEAwCOqtSflYfrw5yI0 4vt3AlOud83bPipijIU+DTPawq6NphAAhngvkMHO+9Owz3xiYf2wrXDi+i5Ln90uoI 4L0jj7U/dFePBBWSq22YdgAHZTHTfIIGcA/kjZIpFWYiLNmnL9BbnJipYVETO+3bwz HTgcwGM9jwaCA== Message-ID: Date: Mon, 3 Nov 2025 11:29:10 +0100 Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird From: Hans Verkuil Subject: Re: [PATCH] media: renesas: rcar_drif: fix device node reference leak in rcar_drif_bond_enabled To: Geert Uytterhoeven , Miaoqian Lin Cc: Fabrizio Castro , Mauro Carvalho Chehab , Magnus Damm , Ramesh Shanmugasundaram , Hans Verkuil , linux-media@vger.kernel.org, linux-renesas-soc@vger.kernel.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org References: <20250903133729.2523130-1-linmq006@gmail.com> Content-Language: en-US, nl In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 03/09/2025 17:09, Geert Uytterhoeven wrote: > On Wed, 3 Sept 2025 at 15:37, Miaoqian Lin wrote: >> The function calls of_parse_phandle() which returns >> a device node with an incremented reference count. When the bonded device >> is not available, the function >> returns NULL without releasing the reference, causing a reference leak. >> >> Add of_node_put(np) to release the device node reference. >> The of_node_put function handles NULL pointers. >> >> Found through static analysis by reviewing the doc of of_parse_phandle() >> and cross-checking its usage patterns across the codebase. >> >> Fixes: 7625ee981af1 ("[media] media: platform: rcar_drif: Add DRIF support") >> Cc: stable@vger.kernel.org >> Signed-off-by: Miaoqian Lin > > Reviewed-by: Geert Uytterhoeven > > Note that this is a duplicate of "[PATCH] media: rcar_drif: Fix an OF > node leak in rcar_drif_bond_enabled()", which was never applied. > > [1] https://lore.kernel.org/20250105111050.3859712-1-joe@pf.is.s.u-tokyo.ac.jp Ah, that patch was never CC-ed to linux-media, so never ended up in our patchwork instance. That's why that wasn't picked up. I'll take this patch instead. Regards, Hans > > Gr{oetje,eeting}s, > > Geert >