Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp445041iog; Mon, 13 Jun 2022 06:07:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy9WeUT8Vmtq7joDJ0P1U9nOagbQthA+Mj20F7FLWVcImmiPAjlgK6BjL7k5fsoNwvY81iV X-Received: by 2002:a63:1b53:0:b0:3fd:168e:d9a with SMTP id b19-20020a631b53000000b003fd168e0d9amr47487901pgm.617.1655125677394; Mon, 13 Jun 2022 06:07:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655125677; cv=none; d=google.com; s=arc-20160816; b=fkHM9VuzTgpFhrMte0uaqga6sJpYKp4b7ohJ8bzMZ3Et6lfVdyouj5srU4NCKtNTHw WELQEXwCXVd9iKMHr8VzQVq0NqrMuOW/xhvDKUJXGBp4e0XdtnCGurzjdVqHbDvmavUr O4PSIpEC7Ag+k+aHZIQxyYofQkNmVuUQJjKKoLnYnvIe8YtIDvkkr/uHsthGRO6hURGR 4n2VpL1XwV2jY/NDc7iDHOWYyUQLY6a/jzyCJWdI4Xo/yjie0JpHljBtQ7TfpLrXKMEG YHd+9V7OiSG7PElyApkQTgBYiHKH606WXKxjPtSAJ9JNs/xQOylSdGlDVgNao17iF0zc 2Azw== 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=UYEYmljl72oFjoHEMn4RM1NfitpOsxB7TFKkNiZImuc=; b=zdhN+GsrHrA6vvg1Y+QaAYaU39hdfSTEnOOa+pqCiAOptPiHvhDB/+f/i54BZ95O8X NKireFhDtFQNMFv5e1Gn+am2QQA5DPJ2L+o2oIVZ6nmZVV8CGI02aykeY5TcJyBBrF5D +nwaUi5ZAdegKNTZHXhJsGLZglbVhoMx+NghHXyPO5YA+rxnkMnCTs2s7Z8sfQ7uyEs2 nDmf80U1RaosM9qwehl+geA106iCcNJlBIeOfXeMGiYT9vXd7hSs1VYZLKau5s8GKwzZ frPsKpRyf+3h3FE35Rq+vtj7dYupPCmTSDFPqMr9ZCiP+letcL30m/CIfAaSTm6+j0JK XaPQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=qQxH7rLw; 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 on7-20020a17090b1d0700b001e868956490si9645525pjb.172.2022.06.13.06.07.41; Mon, 13 Jun 2022 06:07:57 -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=qQxH7rLw; 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 S1347095AbiFMKvb (ORCPT + 99 others); Mon, 13 Jun 2022 06:51:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57674 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345030AbiFMKsL (ORCPT ); Mon, 13 Jun 2022 06:48:11 -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 222142C65B; Mon, 13 Jun 2022 03:26:05 -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 C2586B80E92; Mon, 13 Jun 2022 10:26:03 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 27C08C34114; Mon, 13 Jun 2022 10:26:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1655115962; bh=yezBWBIj2lDVCShdvT7sJfdI2ltpm1U6UJxUTLHm4jA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qQxH7rLwt5VhV/QUQDfjK9FCiWOOIxEo8cBs+ysAhzzy8eqIbPlYYnglshoZZ+fUs lcJCwKOUYMlTdjxpjgETr9lgsQBlBpbSSvghS6YujCFHZjI9MZLjzuJVZLudpBo9tB cfENLsiggMquKcQjosvDxrtkQeEXb/GO5ESAF6r8= 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 4.14 095/218] powerpc/fsl_rio: Fix refcount leak in fsl_rio_setup Date: Mon, 13 Jun 2022 12:09:13 +0200 Message-Id: <20220613094923.429816231@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220613094908.257446132@linuxfoundation.org> References: <20220613094908.257446132@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 5011ffea4e4b..c48ebe677962 100644 --- a/arch/powerpc/sysdev/fsl_rio.c +++ b/arch/powerpc/sysdev/fsl_rio.c @@ -509,8 +509,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