From patchwork Wed Oct 19 08:29:29 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 5153 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp253523wrs; Wed, 19 Oct 2022 03:57:25 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7t9qqaqvZpjiANJ/4klp4iZNSDSHlFKb/AHZ8VTBwRJXJ3rB63t+id8wcQ4dW+PqlUP1PU X-Received: by 2002:a17:907:3f27:b0:78d:ad42:f733 with SMTP id hq39-20020a1709073f2700b0078dad42f733mr6413396ejc.320.1666177044990; Wed, 19 Oct 2022 03:57:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666177044; cv=none; d=google.com; s=arc-20160816; b=TPwTKxthBFpWZNgTZkp857oLx8z5lwAEVdUo2VHBQ7iigST/ah4WjlN0aCWM3Rz6QE G3M5VCx/8yokhxBl3GXZbVeoCvFrUnt7T9SYBsXttdyqYAqoS7pvH6LAmvENQ68ybvro mZjEWPyKO/8jiaOFrNax3aRzz5LEZPMcPBjQbUR6YhWobTK4iSolRXQOsgGYcqlKblq7 GhcIgXJbi1y1+brYIzELcL/Ci0cZiI0dwkBKghjhmDNA9IVkMvg4dEfnBUVb2ThQpeOA vggrMBUrUbdeAU1qGJnvHquS5oPMpse4sbQez0UY924pN/bxz8dI3uHoOnWMFR39qY1A V5dw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=lmx/nv93+kUb6SouQSoeHr3oc8jzJ7zazO2KrXqcVXI=; b=ukonq+YpjeCncc6MX2kD7jhRkrvlDr4TSTK47P3gKkeOBxZ96cYpcLAwj4MY5yaqzI fxIGO7XioFU1vZvRaZD8q1q0EQU+055qp3ysSBzY6UV5V1Td/e48xZ5d6gjaj2bVwrI2 nr2vKXXPavUomx5QbSI8yaW4Zo70gihTBr7BiAcDQJsIhMNB9BPS6w24PeyMQdFq6SWO NzqrxCmQJQwj8f9gmK95SEWtY0DXiBhFM4zbBYBGBcPwJk5jkm6TK1tWNw8Uwxrxaths oNVD+dtwpdL7HL7LuPec45XuZ2ophyk3QMcm0UIM1OhLXoC28XF8NRjQ8lqUH4h0G5n4 u/zg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=yc+cZRUW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id go10-20020a1709070d8a00b0078d4c9d77adsi17234498ejc.94.2022.10.19.03.57.00; Wed, 19 Oct 2022 03:57:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=yc+cZRUW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234614AbiJSK4d (ORCPT + 99 others); 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 X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747113260902281410?= X-GMAIL-MSGID: =?utf-8?q?1747113260902281410?= 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/controllers/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 = -ENODEV; dev_err(&pd->dev, "failed to create ssi controller port\n"); + of_node_put(child); goto out3; } }