From nobody Fri Oct 17 13:27:04 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id EB324C433FE for ; Wed, 19 Oct 2022 10:56:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234621AbiJSK4d (ORCPT ); Wed, 19 Oct 2022 06:56:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51942 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234156AbiJSKzl (ORCPT ); Wed, 19 Oct 2022 06:55:41 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4171FAB81B; Wed, 19 Oct 2022 03:27:26 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id D34D6B82458; Wed, 19 Oct 2022 09:00:28 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3B862C433C1; Wed, 19 Oct 2022 09:00:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666170027; bh=9+NtXeXBvF4Ebv92J6wPhWRQ5nQ9JXpxZQzq7UfEEhk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=yc+cZRUWczFkRLPP32r7GnpXb+RqHLewZqKn8iXpiJPS5P3wz/cNQKdy1aOOAnVVl 2iZMRu5SpRpZiIyarR8PRCR+2/yw/08l/BZ+9lO32iLSSOcWCIZLWs0ADg6ICWufBM NbRFSToMfDQS6INCbiMOiVeb8dA6X8lsun+vDY/Q= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Miaoqian Lin , Sebastian Reichel , Sasha Levin Subject: [PATCH 6.0 482/862] HSI: omap_ssi: Fix refcount leak in ssi_probe Date: Wed, 19 Oct 2022 10:29:29 +0200 Message-Id: <20221019083311.253973912@linuxfoundation.org> X-Mailer: git-send-email 2.38.0 In-Reply-To: <20221019083249.951566199@linuxfoundation.org> References: <20221019083249.951566199@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Miaoqian Lin [ Upstream commit 9a2ea132df860177b33c9fd421b26c4e9a0a9396 ] When returning or breaking early from a for_each_available_child_of_node() loop, we need to explicitly call of_node_put() on the child node to possibly release the node. Fixes: b209e047bc74 ("HSI: Introduce OMAP SSI driver") Signed-off-by: Miaoqian Lin Signed-off-by: Sebastian Reichel Signed-off-by: Sasha Levin --- drivers/hsi/controllers/omap_ssi_core.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/hsi/controllers/omap_ssi_core.c b/drivers/hsi/controll= ers/omap_ssi_core.c index 44a3f5660c10..eb9820158318 100644 --- a/drivers/hsi/controllers/omap_ssi_core.c +++ b/drivers/hsi/controllers/omap_ssi_core.c @@ -524,6 +524,7 @@ static int ssi_probe(struct platform_device *pd) if (!childpdev) { err =3D -ENODEV; dev_err(&pd->dev, "failed to create ssi controller port\n"); + of_node_put(child); goto out3; } } --=20 2.35.1