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 DC2F93B27F3; Mon, 23 Mar 2026 14:09:51 +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=1774274991; cv=none; b=ZFGFS4akmj6valBJST1a3RO5hX+KNR7yAqFQWBRrskT/x27UCvGerdf/U320ug12S72d0n1Pm8bCgdysTyKggtk25eM6Wm433VrA2Z0unoH/r8bpUPO3m8ppDHa/QDGC9czDRQnjjLYTmxnHz36VfB83kDFMV/gpvHldjCnJMO4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774274991; c=relaxed/simple; bh=TktIoEVVanfo/cbbwgkI/YK10MxZO4iev+b3aS2ejf8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=N65Z+z+27nM8bIDeYo6L9rdc3YEEPNRlXRiHcXihKvGCQ8RSCBDUPR6k7Jq3OpUJTITGSLBMNhNCaf8qQXV0ThVSTD58DmzsVRMJ3sqVyZG2ljPG5Mh/qFUfbdIXlNWGTaD4roN2PBOy3LvNwKDh24DRLdzbf+H2J2hJKMcob3E= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=XGYz3iGv; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="XGYz3iGv" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 36E17C4CEF7; Mon, 23 Mar 2026 14:09:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1774274991; bh=TktIoEVVanfo/cbbwgkI/YK10MxZO4iev+b3aS2ejf8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XGYz3iGv+gmXSw2Fx22NYlUUyqOIx5HF8YJNH/KB/XNebKuvKC6tgT5HzR3QRs5bN xKsU40bsUHf1gmKY9Uqux4s7ypWgRwrxvr3P8GBppy1FSFRRyiYDsINVtxJhkl0imu n//lkfupPxABCj4pj2qQ0S/IuVJPi4TIHADDFp7s= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Christophe JAILLET , Andi Shyti Subject: [PATCH 6.18 186/212] i2c: fsi: Fix a potential leak in fsi_i2c_probe() Date: Mon, 23 Mar 2026 14:46:47 +0100 Message-ID: <20260323134509.620195033@linuxfoundation.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260323134503.770111826@linuxfoundation.org> References: <20260323134503.770111826@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.18-stable review patch. If anyone has any objections, please let me know. ------------------ From: Christophe JAILLET commit be627abcc0d5dbd5882873bd85fbc18aa3d189ed upstream. In the commit in Fixes:, when the code has been updated to use an explicit for loop, instead of for_each_available_child_of_node(), the assumption that a reference to a device_node structure would be released at each iteration has been broken. Now, an explicit of_node_put() is needed to release the reference. Fixes: 095561f476ab ("i2c: fsi: Create busses for all ports") Signed-off-by: Christophe JAILLET Cc: # v5.3+ Signed-off-by: Andi Shyti Link: https://lore.kernel.org/r/fd805c39f8de51edf303856103d782138a1633c8.1772382022.git.christophe.jaillet@wanadoo.fr Signed-off-by: Greg Kroah-Hartman --- drivers/i2c/busses/i2c-fsi.c | 1 + 1 file changed, 1 insertion(+) --- a/drivers/i2c/busses/i2c-fsi.c +++ b/drivers/i2c/busses/i2c-fsi.c @@ -728,6 +728,7 @@ static int fsi_i2c_probe(struct device * rc = i2c_add_adapter(&port->adapter); if (rc < 0) { dev_err(dev, "Failed to register adapter: %d\n", rc); + of_node_put(np); kfree(port); continue; }