Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp438095iog; Mon, 13 Jun 2022 06:02:23 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxG3JuoIG8Mj/yW0a2bw5wE/V15S79NPsx/KcGE5PHl6l+5aovwI3aCVSnSEXwyeIyqkQzs X-Received: by 2002:aa7:cdd5:0:b0:42d:b87a:6d7 with SMTP id h21-20020aa7cdd5000000b0042db87a06d7mr65446296edw.91.1655125342952; Mon, 13 Jun 2022 06:02:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655125342; cv=none; d=google.com; s=arc-20160816; b=WW5mrnGhgp65jf1aL25m3vqVRfXFO97ieu7eA01SBGA0hMxMvmw/RI4o+Mv6QcPJ0c vb2apMmWYTCNgV2Fu7wR/BCXO2J19T8kMVc1/9iMO1Xad+DnlDH6j4JVYYFgrGfx0xCD UXYosWl2GQILH/E6oINZxqriIB5NQ9YOoWPxuCJosWRcjGl7xvtFr0qZ+X5VgP7xP0EQ K+FpJotpI+dFgKSWkP4495+w8vDzGt2maezoDQCnGRefHsjxbCn71xjyOG6wehctQZmd Pt4+rLZjVomsTCqJak/fFuXjp5rmaTthVw+5cyb1FagiL9Upwji0DODhnFMvrUocHfGY vMKg== 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=NMaReV52Bj9/VO3birVd0gTa0Q3WJ2oUMUnkOGmXwcoBxrjbWKgHCGX6qvkJaXpqdm KeKtEBHJUHyabdrhPxnwJvLUJWov1n4gs59tJiRVgA8G0/Oukmm24AFVANiCQwcg4cY1 rWtx47npc9ISXXeKp4W4l0vuf/mozk/8O5831PzfkJorHY359qS6ax203Z3Xtfn4f8DL ZxY14qT3HnemjxkdqZ4PwAtHU6z7gdBrHMuDRnuxvsxvwKjWpvkqugxvO/tP2CLiH+xH bY9sIA6SiRIP20ywnCIbi8dSa4BVi3ohxbW2EPzSW+siykBzH8FJJoIqnwzPIwOMQ6Sf jrbQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=UmrYmfgP; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w21-20020a05640234d500b0042defb7235csi8765094edc.202.2022.06.13.06.01.55; Mon, 13 Jun 2022 06:02:22 -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=UmrYmfgP; 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 S1352857AbiFMLWX (ORCPT + 99 others); Mon, 13 Jun 2022 07:22:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46672 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1353783AbiFMLQw (ORCPT ); Mon, 13 Jun 2022 07:16:52 -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 529AF15736; Mon, 13 Jun 2022 03:40: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 ams.source.kernel.org (Postfix) with ESMTPS id 4B445B80EA3; Mon, 13 Jun 2022 10:40:06 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9E1E0C36B02; Mon, 13 Jun 2022 10:40:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1655116805; bh=1QLzhrmPaBDasbV1MuyL7akoWZqN/JmMdcgAMgH4qjM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=UmrYmfgP1UKp/1IbMCkkns453IYJf2sEaEkvOMHwmJXNROHvoxTlWABmRCoGxhNmH qJI8m3+/rvxCPHpsE188iEL5/MHGDU2bN3JlO0wr+tjif+Kegej8ufgWBWRXgMlZCM Q41Rnxap4DbB1LrSvluU16wvmBSbey4ZoFxuMr6g= 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.4 191/411] powerpc/fsl_rio: Fix refcount leak in fsl_rio_setup Date: Mon, 13 Jun 2022 12:07:44 +0200 Message-Id: <20220613094934.387695295@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220613094928.482772422@linuxfoundation.org> References: <20220613094928.482772422@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=-8.3 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,T_SCC_BODY_TEXT_LINE 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 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