Received: by 2002:a05:6358:5282:b0:b5:90e7:25cb with SMTP id g2csp3353203rwa; Tue, 23 Aug 2022 03:25:06 -0700 (PDT) X-Google-Smtp-Source: AA6agR52S4pA/LwP74CWOsEIXrg8FYMbIiIojSuBSUorTVRkh/f80p1DEKU4PY5r63qNVqbIKNTJ X-Received: by 2002:a05:6402:3907:b0:431:6776:64e7 with SMTP id fe7-20020a056402390700b00431677664e7mr3045324edb.0.1661250306210; Tue, 23 Aug 2022 03:25:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661250306; cv=none; d=google.com; s=arc-20160816; b=ib++K8lRtqHntm4F8PbTOsf12B0sxBOfwDCHCKplPupkd+qwt5WETeYGrSsTZRHoCc 0jbZVJWcjct4llnvgOCG7x5T/+J5FCV/SufxukTMeGlk2ZceTykGn51sq5aWjXHU1wom yv04uRb06g/fC2cUV492cTPKFYQnjqFie82tGkJm8tIdlmX0wj4FrlkdpARq8snrRE6w Bo+lkrQMxL1PCoI3FS9+k0I91smdOVy2V5+XdfeM6E7vsmF1/anSD5fxtyB5WlN8fq3p J0NlpFW9sOfTZkN9FADWtY2/QCzCHcm8pbGw24buTp9msk5TshTYnXeMJZmOQN11VFNq WGsg== 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=QXCmDccMV+gFsILLy5ud6dOGT/l5F1FcbOGJ064Nvu1XmWeSXO9guQyjgCMZ5tCNFL 0lyG9P/o6FmVlIPy+rJCVHVQ2N2wfKulk/h3jxoEGRvV3eU1KXcgT/Ka1SQkjJqADYKG IeIsrR+e5otB4u8eMETfVDJT1KF24yb23wRpDpegkO3Hw4PQzNmwlPJpUx7R+ru0ncqd sYh6LIhL7Ur9zqCyHfOeX/Olp1AUvJark9CPdWFMUS1J6EBekBYrONFF23MCjdLB4fm4 etUwymIlSPm8RqJyWrLr8D8XLV1i8bjaCGZh4JTUdfBaXonTE3zrxOR9GcJgFHdlUfKs FeXQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="D/NJ5qw/"; 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 jg21-20020a170907971500b0072ab62ae019si11405644ejc.859.2022.08.23.03.24.40; Tue, 23 Aug 2022 03:25:06 -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="D/NJ5qw/"; 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 S1354558AbiHWKVo (ORCPT + 99 others); Tue, 23 Aug 2022 06:21:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58332 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1352409AbiHWKJe (ORCPT ); Tue, 23 Aug 2022 06:09:34 -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 5D6267DF60; Tue, 23 Aug 2022 01:55:40 -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 EE8DB6155E; Tue, 23 Aug 2022 08:55:39 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 03619C433D6; Tue, 23 Aug 2022 08:55:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1661244939; bh=9krYIMZkWByFYm0Z2MCMjTdo/cKY77hHZASSi3Elm3k=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=D/NJ5qw/4jaMtaLSXA4dotY5kXfoCsmtOEE/KY+7w6+CsO9WchRO7Tu5azfEbXzoI 0Tk6bglQGev9mkheWPCvWcNQu872+O+gM6g9Hpl40/Mdakn4Q8FqhfdquBpO7pDcwr SGg7FEr8jY38BACMcqyQahActd0pPHEyfbtB2EAA= 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.15 175/244] usb: renesas: Fix refcount leak bug Date: Tue, 23 Aug 2022 10:25:34 +0200 Message-Id: <20220823080105.129109668@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220823080059.091088642@linuxfoundation.org> References: <20220823080059.091088642@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