Received: by 2002:a05:6358:5282:b0:b5:90e7:25cb with SMTP id g2csp3407467rwa; Tue, 23 Aug 2022 04:23:13 -0700 (PDT) X-Google-Smtp-Source: AA6agR4oF/2iu8QZHXHRLF3jy3u3/SlDOw70rRcZaj1ck+5Agi0S/xtqnGEx51g2GTXlSsNotkqL X-Received: by 2002:a63:6884:0:b0:415:b761:efa4 with SMTP id d126-20020a636884000000b00415b761efa4mr20755522pgc.274.1661253792882; Tue, 23 Aug 2022 04:23:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661253792; cv=none; d=google.com; s=arc-20160816; b=Vg0frmoXhruVy3GKeNGepLzKPZVuCy6uZ/inQ+JWIdGZjiWpoYOWHC9gulJ234T6t4 +iJadBSgQBvqqvaTlubQ2zbuJRYWpuXtQCvE/Uv9p4jYuotDP5p1R1oJzyVn4NaQ34xR XkcS2ZoARhA+LkNyoMvjGZlUt1vLlOw/fd2UPKzlPoo9M8ND3C5HnBbaC0MjM31Wd7n4 axl0iNSYlBPjcSQJzeKhBYqUN7E6UgqCojZSEmKz9kf4kMclwYEDlBDBOhRyMQ6ilyq0 33aGumWtuyPqhKU8KgAwYeeHJCoaVHfqB5BxCwpD4QUroP0F6kDin7lf5DZga1z+ma+D SAKw== 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=1lcxfKVpkyf8yUH5/bVXiXKNn71w7YAgm3BKZkjASck=; b=iuQglRC9WkedhVS/ELFg+VlWB/IBYhoh26seCEpiyBNk+8CHVsjb0LzbmIH8UYLg2G CSoZiqy2gUtJbol3sS9wiZwvONbh0DVaU+5zY3nfYOIHzLjsbNG5xdo0Zec7kciyZzw6 POw7SSyMxwuG1G8IPJ6XnU8BMj/ji0QxNRLy0VZMpgjUlUIHEM5Apn8ocJFrhJjhacbo XZgh9G4waE9v16xpqlWfkTaxvGT7QelkEPL/e54Zpt9JF2iD+nR3ISsJtNKdmAscxxOl sllzkSSvSgfHzrLgJNPHKrVPOnbRaMyxGHBtyqNgJvxgz9MzEKNorllnazRq/XeHg01O XDaQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=f4wyvK9f; 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 ca17-20020a17090af31100b001fae2cf9cb9si11884123pjb.149.2022.08.23.04.23.00; Tue, 23 Aug 2022 04:23:12 -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=f4wyvK9f; 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 S1356462AbiHWK64 (ORCPT + 99 others); Tue, 23 Aug 2022 06:58:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51864 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1357145AbiHWK4l (ORCPT ); Tue, 23 Aug 2022 06:56:41 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A71B0659E6; Tue, 23 Aug 2022 02:13:36 -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 C5D36B81B1F; Tue, 23 Aug 2022 09:13:34 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D924DC433D7; Tue, 23 Aug 2022 09:13:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1661246013; bh=8A6QbEDeVE05BipQeK/y/HSW6DcAP+4/Y6s7JDGdNFw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=f4wyvK9fDMvDy20HNpO6RSAZyT4kWbnY11U+fWX8gTPC+h7Q4kdcpK6zSnp6CUf/B WvG7FuE/1HeOjBTTfHxfW8wJdk3iMKnLYXnWirhdcaCD1Udco28B/UXB5q338S6arD xoRQdbjwx3JVxiiO+6zGSnAk47mLp+dTLj/2shww= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Liang He , Sasha Levin Subject: [PATCH 4.19 261/287] usb: renesas: Fix refcount leak bug Date: Tue, 23 Aug 2022 10:27:10 +0200 Message-Id: <20220823080110.078747414@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220823080100.268827165@linuxfoundation.org> References: <20220823080100.268827165@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 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: Liang He [ Upstream commit 9d6d5303c39b8bc182475b22f45504106a07f086 ] In usbhs_rza1_hardware_init(), of_find_node_by_name() will return a node pointer with refcount incremented. We should use of_node_put() when it is not used anymore. Signed-off-by: Liang He Link: https://lore.kernel.org/r/20220618023205.4056548-1-windhl@126.com Signed-off-by: Greg Kroah-Hartman Signed-off-by: Sasha Levin --- drivers/usb/renesas_usbhs/rza.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/usb/renesas_usbhs/rza.c b/drivers/usb/renesas_usbhs/rza.c index 5b287257ec11..04eeaf6a028a 100644 --- a/drivers/usb/renesas_usbhs/rza.c +++ b/drivers/usb/renesas_usbhs/rza.c @@ -23,6 +23,10 @@ static int usbhs_rza1_hardware_init(struct platform_device *pdev) extal_clk = of_find_node_by_name(NULL, "extal"); of_property_read_u32(usb_x1_clk, "clock-frequency", &freq_usb); of_property_read_u32(extal_clk, "clock-frequency", &freq_extal); + + of_node_put(usb_x1_clk); + of_node_put(extal_clk); + if (freq_usb == 0) { if (freq_extal == 12000000) { /* Select 12MHz XTAL */ -- 2.35.1