From patchwork Mon Oct 24 11:30:26 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 9365 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp476355wru; Mon, 24 Oct 2022 07:13:46 -0700 (PDT) X-Google-Smtp-Source: AMsMyM44umnujTTDLGIQ8MF2M6EhT4Wzun/fUdX6ZPL72fcgjtbRZoUH6MjBqbLhjLdDLg399VWd X-Received: by 2002:a05:6402:90e:b0:443:ec4b:2b03 with SMTP id g14-20020a056402090e00b00443ec4b2b03mr30541377edz.71.1666620826321; Mon, 24 Oct 2022 07:13:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666620826; cv=none; d=google.com; s=arc-20160816; b=lt4+oIvRdasq9+IcGpN5sLgwm/3aomApvzpeH5ETo6cOp0DfyTCeyiaf83rSl680IW DMby4wsJun9rY+f4Vl57eJYJDBn+/FvqMuyJhGV8eyTfo9v76RJrQRmAGScBcz+Z5MQ0 tRki+hEZHWb+09hPSJcwD4emPoKdJnhg1sEeAj/ZEFUe8Y9fQ394B/1lee+eAB/y9naz CUThMQPREZRkovuYDTQkext42SgUGuVgjk2na2tqZdvXS0GWiIkSs6NfB1zPWGCy+SVu wcS70zs/3rAYtW1rrn9sX5gLa1gTSXMj99sXn0Ia//I0+ZuvTExwjLe6mwwmz5XxcAMS 1xjA== 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=Zz9/wIWCy8s4QrWc7z9Y2LgoB5jTYDurm2jk7/eNYoR9w7wgUEmxo5hbkgK1d2F0DN 7Tsn2C7p3DtnXGyHcXmnt8Q1sd8AxUuFlrOXkC/rUJ3PXo7FMv+YrND/Eo4dfYTHFLAd A6+ANH5rRbJRW9gBb9VSmgO2TApbayrU/QYZphzRdZ/1I1eRwxP1SfXd0MzQl2iNcSMp pIkvy1D/s+BKhe/5EQmBl8bdEw4Uc/xpkLD3VWvoJ1WnliR0IEmPF8gUB1uTO4uX4MZ2 kCGw+pZr9TxZxVrcJK0TNhUzyQIKcJ72206PSLFNWTlW7PfYmXWfzFUCBiPnu5GuCS5M z6+g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Gi9+Vy8r; 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 hv20-20020a17090760d400b00791a67e4c00si17173803ejc.835.2022.10.24.07.13.22; Mon, 24 Oct 2022 07:13:46 -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=Gi9+Vy8r; 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 S235020AbiJXOAB (ORCPT + 99 others); Mon, 24 Oct 2022 10:00:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41316 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236753AbiJXN6d (ORCPT ); Mon, 24 Oct 2022 09:58:33 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C7DA131DE1; Mon, 24 Oct 2022 05:45:52 -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 dfw.source.kernel.org (Postfix) with ESMTPS id 33D3361328; Mon, 24 Oct 2022 12:45:21 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 41F0BC433C1; Mon, 24 Oct 2022 12:45:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666615520; bh=9+NtXeXBvF4Ebv92J6wPhWRQ5nQ9JXpxZQzq7UfEEhk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Gi9+Vy8rc7FGKTKEkxG6lhiCSZPYtK3ozE6V+Lqak3dxoCqHXaqOKL9uE0BV/RWhn 8fdeFdEW7PfbWmrrrO9kZOR7ryRWVww/6GOItJtMQz1zAt0/j3zRVx6C6e61F8JVpe GxbqqMpTq/tettXKYVemvWZJeWeqy6N4zXkcYHYc= 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 5.15 282/530] HSI: omap_ssi: Fix refcount leak in ssi_probe Date: Mon, 24 Oct 2022 13:30:26 +0200 Message-Id: <20221024113057.837457886@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221024113044.976326639@linuxfoundation.org> References: <20221024113044.976326639@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 X-Spam-Status: No, score=-7.6 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?1747578599881860210?= X-GMAIL-MSGID: =?utf-8?q?1747578599881860210?= 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; } }