Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp2197491iof; Tue, 7 Jun 2022 22:56:41 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwjoWEpEK/rguHg3yfmppAyBVPCuzyvrfB7xKn0K2W+icgcNE3fg29Uszp6iV6UpBHuud5e X-Received: by 2002:a17:902:b282:b0:163:ffe6:2cf9 with SMTP id u2-20020a170902b28200b00163ffe62cf9mr33035951plr.76.1654667801201; Tue, 07 Jun 2022 22:56:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654667801; cv=none; d=google.com; s=arc-20160816; b=jwhpTPaSG05vyUBpcw0cDhXDrVyAVRVJwFlq2X7KU63mtJEDNC2m+eALMjireui4ws 7uUlZfQi8t+scA/AH76Ia0IeHDLD774tCuz/NVOkrY0hC/9l4QD75QefpcNNuGdqH8iI pMl3jYmQ7Z2hOBMeVYgTkKrfQUogwhHSjmYg5e4TiiJgMxGk0lE/LWeyWduOZQkFbCn1 zmQgRC8Ks08G1GGj6C9UslOuvvxh0HSxwwAl/XzH3GQ6YwyStS2orlgWYM8qHlApZe23 f/VWpE41M3K1igcj/1UShvsdl0rr8cFqem5ZyLfHeAjCCDZHqt2YI3kNKUEmWgyv3shf alog== 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=NZNIDI2XSi6fIN7+SA2NCcmkECPoxrDNoTPYYtACpQY=; b=mmmIb6UnMwtJZlHnmHzTycGAzbyyLjD/Fh64Mzovd5QmqhEcrXdoaPTXfPsiJ9fTuP PAqAAE9zfjlcvuEbJSrq3qX40z2xbLukldhr7+FQW+tOQ56pAKyGgIC7Fe9t2AnQe0xh dCOkwzlW7azbLQMo2UUYXhqR1Jb0h5/68biwSKL25Y++tAFKr+CqWiO5uiVtm9CNXPdK U7n4FwqtzA0v+XjHWmdZC/8mK7jqIvgSyoT2QaMroDxLvaNK2XO79iea5NB8Mqkybddj Ui/XMkoB1GCVLekKRAxTcy02rY4wlko9JQKR3QAotZhgrnP1usKJk0+XTlGGgVeL/A6J BFzA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=c6Lqoutb; 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 1-20020a631741000000b003f8bcaac469si28597043pgx.24.2022.06.07.22.56.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Jun 2022 22:56:41 -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=c6Lqoutb; 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 3EC404B26F1; Tue, 7 Jun 2022 22:22:38 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1443919AbiFHBBL (ORCPT + 99 others); Tue, 7 Jun 2022 21:01:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38214 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1382456AbiFGWCs (ORCPT ); Tue, 7 Jun 2022 18:02:48 -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 9990D2506B6; Tue, 7 Jun 2022 12:15:08 -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 E677B6192E; Tue, 7 Jun 2022 19:15:07 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 03318C385A2; Tue, 7 Jun 2022 19:15:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1654629307; bh=BoCwaUwe0tzXJQx2T6vSAyNpEwsx4tVKbe48hAydr+A=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=c6Lqoutb8hyIOUHqyVL9gXdws52/G5MuxtIPNlc7y2VElZPGyJtMWhvYDxBpdh6Ih /xGJHvrS4s3GJj2SUqax/drCQYW7nIhCZDBg32BbwX6nSGyd8repCzuznPlPRlkPN2 Q1LzjjhxDqwjAHRT3Xj+tQPPGbhc966lR5FQNdZM= 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.18 645/879] powerpc/fsl_rio: Fix refcount leak in fsl_rio_setup Date: Tue, 7 Jun 2022 19:02:43 +0200 Message-Id: <20220607165021.569455975@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220607165002.659942637@linuxfoundation.org> References: <20220607165002.659942637@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 ff7906b48ca1..1bfc9afa8a1a 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