Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp2287167iof; Wed, 8 Jun 2022 01:28:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzLDOfj4y1sPyB5uWqtyqz1JX1M8zjsjHEPtI8PM7vHT1nqHAH5nME6+KCycv7c36tXiqPe X-Received: by 2002:a65:6e44:0:b0:3db:219e:2250 with SMTP id be4-20020a656e44000000b003db219e2250mr29232461pgb.369.1654676937042; Wed, 08 Jun 2022 01:28:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654676937; cv=none; d=google.com; s=arc-20160816; b=RT/YdX0UQuxbKQyg0D8coH5AoZNS5/aKJp/U/OScPFSV/CkpK7roEPOVSFSaFLSAW0 qKUstv7otG9mKtEsDlhWYt1RV1tNiO4Wn/+ALiHn24twRspPb/yAbtSALwVQ/WgL3lir wAVW3o5gGaLxOGgHS9jB+Gb/uXKjuytB5f/vS4q5YFBgGXWmck6bNh60cJ7v2lPLiATb MacKqMS+RLNj2N/IAc0pUW4YVkO0QfLo5rAvhYz4BfsN+4FDHWmXNjeinpj+nUp3dCyJ pz3UfsCWqalgiZ7mIGRvTx4tPHoI462KC6OCxqQ9jOmpzpVjGXTfQAwK/oTR9owiMAsQ 9GLQ== 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=QbqzsI9dVKF1edyOrVH9Lk4dA8OGWStERUMULH45Bzs=; b=ptKmeCjB6HnIIb7enWv+vNSPgiwIq8SASl5E8Ga6ayBTOkALSZdmsGqWlpxx79zLSx kkL0jF4Na/2kK4TYzD9dPOzpNmzFJYx1H2zsjTDs48Clc9FYWya1DMWjVo21j64bhL4Y 8g5a5bTKX9ac6wFrQuMRvv8Y6HrgRD9sUp6xDdD/3CNqCiJfZyFPukfh7ugSQlxpIQu4 MJFrvszCSWfRIUBdH0doE5BXvafTTuFmw1Su4g6YjcHxPH5ft8nsnnmK8+9zKtVncl7J wBZSfBd8wpErVKDyHSFArFOJ4rt7ZaJjSraUeYuzWiy2OdzozrgxcUGz+8AG63Ec4rq8 1UuA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="IL/bBZ9l"; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id u76-20020a62794f000000b0051bd440b069si20636728pfc.14.2022.06.08.01.28.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Jun 2022 01:28:57 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="IL/bBZ9l"; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 86A5922D658; Wed, 8 Jun 2022 00:57:57 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1348495AbiFGRy0 (ORCPT + 99 others); Tue, 7 Jun 2022 13:54:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53190 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1348409AbiFGRgU (ORCPT ); Tue, 7 Jun 2022 13:36:20 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EA4C41C11C; Tue, 7 Jun 2022 10:32:38 -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 C029661534; Tue, 7 Jun 2022 17:32:30 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D2504C385A5; Tue, 7 Jun 2022 17:32:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1654623150; bh=1QLzhrmPaBDasbV1MuyL7akoWZqN/JmMdcgAMgH4qjM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=IL/bBZ9lo1u/HGNvVpzvWDd8el/wP6ngKAPHx5oB1h1iOJLfFjgUVvlUWhU1ApuyI SY5JFGOtfqcNBLVy7M270ee2E+khHUJz7Y2cFT8MY7uWWeJbtdayitvnFqYVEKU8+8 EIE3izxVuLVBtXId5YctvMh/AMreIZMHjzANT1co= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Miaoqian Lin , Michael Ellerman , Sasha Levin Subject: [PATCH 5.10 313/452] powerpc/fsl_rio: Fix refcount leak in fsl_rio_setup Date: Tue, 7 Jun 2022 19:02:50 +0200 Message-Id: <20220607164917.887571378@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220607164908.521895282@linuxfoundation.org> References: <20220607164908.521895282@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-3.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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 From: Miaoqian Lin [ Upstream commit fcee96924ba1596ca80a6770b2567ca546f9a482 ] of_parse_phandle() returns a node pointer with refcount incremented, we should use of_node_put() on it when not need anymore. Add missing of_node_put() to avoid refcount leak. Fixes: abc3aeae3aaa ("fsl-rio: Add two ports and rapidio message units support") Signed-off-by: Miaoqian Lin Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220512123724.62931-1-linmq006@gmail.com Signed-off-by: Sasha Levin --- arch/powerpc/sysdev/fsl_rio.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/powerpc/sysdev/fsl_rio.c b/arch/powerpc/sysdev/fsl_rio.c index 07c164f7f8cf..3f9f78621cf3 100644 --- a/arch/powerpc/sysdev/fsl_rio.c +++ b/arch/powerpc/sysdev/fsl_rio.c @@ -505,8 +505,10 @@ int fsl_rio_setup(struct platform_device *dev) if (rc) { dev_err(&dev->dev, "Can't get %pOF property 'reg'\n", rmu_node); + of_node_put(rmu_node); goto err_rmu; } + of_node_put(rmu_node); rmu_regs_win = ioremap(rmu_regs.start, resource_size(&rmu_regs)); if (!rmu_regs_win) { dev_err(&dev->dev, "Unable to map rmu register window\n"); -- 2.35.1