Received: by 2002:a05:6358:5282:b0:b5:90e7:25cb with SMTP id g2csp3323809rwa; Tue, 23 Aug 2022 02:51:08 -0700 (PDT) X-Google-Smtp-Source: AA6agR6xJOaWmqM6DgiymognqTHEZQ2WzQuoLzKsSOCf5txiX2ul0RO1kVsYVAeHJ+91ZbBzrbag X-Received: by 2002:a05:6402:270c:b0:446:f754:371a with SMTP id y12-20020a056402270c00b00446f754371amr2994139edd.388.1661248268287; Tue, 23 Aug 2022 02:51:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661248268; cv=none; d=google.com; s=arc-20160816; b=0s/6jNAOTqt7vcPYgqlB0pNu6v8uAlj4GrSzF1FcMKg1qt6CbZtlGJdGA1ya0xy7e0 lHO/KmBSv4LUa3BtKF5HQAvIJpGOrEgNF5hI269/X5pwpiiNI+J7HYLpLm7X2kElgFg9 pNZcqAAKu5TOj4kGQImjQBaPpVyoSCOAmkISbAvzT/us/caWEYCtKucBVrpdA84bfCep GFw9edBXVxenyj8rm5nh4STBX1yBg1yIgWvHxybCjAMeKA6ZeyptX24b0xBy4dzYGNGI b2+87jxx1RC+cyAFzZBKHMy9cxJhXqZaj/kBkWJJ5Duf8BVyGoQ+Tq2BtJej0mauSb2A Fp+g== 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=ETGeoDmma1bgLjpqLJWQqxkxSXeDhYO2AX1TNXnrRtQ=; b=gaZ+9lzUbYZtUWznWFrNk2XtYDomQQ4FQUgnc3RUsJkPUXOilpUiRTo6KBvq9SSKW0 oXIlBHuaeahRaipwiGpSUFfSqYqKoPLs9ZXaNC/fFFhH3S0ctWuhhjJt3ZUqvFoTRwjp 31/w95kS/E45fRaJhTytXJ6tzfSqGXtJI5cxPsOTvEf+GMMLAf1G8y1MIxNDO9PzJwfa 9qDOlip6SA5vMUcyZrozNk3yHjZHeKARE7VCVTAUsPJLyzFrteVyo1LJHoW9mBXDDsqc +ovOQNsLF+GxbZkHg4G2l97LQE+YP1T6KFeLfspAQks2M9SzpaCF4z17mHALlPcGiGC4 nRLg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=bqjDWb8f; 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 qk15-20020a1709077f8f00b0073d6430df46si9275933ejc.974.2022.08.23.02.50.43; Tue, 23 Aug 2022 02:51:08 -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=bqjDWb8f; 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 S1348289AbiHWJKR (ORCPT + 99 others); Tue, 23 Aug 2022 05:10:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54480 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241164AbiHWJIj (ORCPT ); Tue, 23 Aug 2022 05:08:39 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D1F17861E4; Tue, 23 Aug 2022 01:30:33 -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 3BB8AB81BF8; Tue, 23 Aug 2022 08:30:33 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9FE88C433C1; Tue, 23 Aug 2022 08:30:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1661243432; bh=9krYIMZkWByFYm0Z2MCMjTdo/cKY77hHZASSi3Elm3k=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=bqjDWb8fUcJXTT4aiSbg8EciVWp3h7UohDURdcm8vRcK8iqz4mvK8+BQXkV4Balih Bqr5Wk4fIpLa6LynU7gRz0Q3KWNDR5j5/MavRgs0B01HsvHw+Jsi+Ln0i+VhdFRc0+ 9rS27Ggc9/ZuKRAVomTo+mtdN6tnlPOunv07wo4g= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Liang He , Sasha Levin Subject: [PATCH 5.19 276/365] usb: renesas: Fix refcount leak bug Date: Tue, 23 Aug 2022 10:02:57 +0200 Message-Id: <20220823080129.707182177@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220823080118.128342613@linuxfoundation.org> References: <20220823080118.128342613@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 24de64edb674..2d77edefb4b3 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