From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 81092C25B06 for ; Sun, 14 Aug 2022 15:42:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241051AbiHNPmT (ORCPT ); Sun, 14 Aug 2022 11:42:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37214 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241581AbiHNPl5 (ORCPT ); Sun, 14 Aug 2022 11:41:57 -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 2E70E23165; Sun, 14 Aug 2022 08:33:19 -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 28754B80B4D; Sun, 14 Aug 2022 15:33:18 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2AD99C433D6; Sun, 14 Aug 2022 15:33:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1660491196; bh=0LLFBfOKHFPod6bxQlh8610jSWOZ/Fs0Wgi1kYBiWWk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=UqXk83PhSsG/V6e7e1gd83UM7+JZ7GRHdi2I9v/+6aSdKUB+qOULUsqTwiCrMfFc8 XBVwCl0J0ZgzBau/0pVKqgNsqVHosO5G0Lumeel/DXBt+caALBtuv/+eCEFVcY2U/0 VGAHNTgm+inEXUy0ggmxkNNyYrSFEDV//qnY65E48JtabobcY0ztp34244wfN9lmn/ eqNg07Kfrrg3NZQopojrYQwmgtxaZ+lnENs42yqQbpzHOyXQRL1hXwR3N3jXmlC8TL o09GLE7xYyw2aOZ9bIauJykp3kPaUTcWhAqF+roVcomV/EizQGApULYt/jsx5Ai9D4 thICB0WRXNy0g== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Liang He , Alan Stern , Greg Kroah-Hartman , Sasha Levin , linux-usb@vger.kernel.org Subject: [PATCH AUTOSEL 5.15 13/46] usb: host: ohci-ppc-of: Fix refcount leak bug Date: Sun, 14 Aug 2022 11:32:14 -0400 Message-Id: <20220814153247.2378312-13-sashal@kernel.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220814153247.2378312-1-sashal@kernel.org> References: <20220814153247.2378312-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Liang He [ Upstream commit 40a959d7042bb7711e404ad2318b30e9f92c6b9b ] In ohci_hcd_ppc_of_probe(), of_find_compatible_node() will return a node pointer with refcount incremented. We should use of_node_put() when it is not used anymore. Acked-by: Alan Stern Signed-off-by: Liang He Link: https://lore.kernel.org/r/20220617034637.4003115-1-windhl@126.com Signed-off-by: Greg Kroah-Hartman Signed-off-by: Sasha Levin --- drivers/usb/host/ohci-ppc-of.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/usb/host/ohci-ppc-of.c b/drivers/usb/host/ohci-ppc-of.c index 45f7cceb6df3..98e46725999e 100644 --- a/drivers/usb/host/ohci-ppc-of.c +++ b/drivers/usb/host/ohci-ppc-of.c @@ -169,6 +169,7 @@ static int ohci_hcd_ppc_of_probe(struct platform_device *op) release_mem_region(res.start, 0x4); } else pr_debug("%s: cannot get ehci offset from fdt\n", __FILE__); + of_node_put(np); } irq_dispose_mapping(irq); -- 2.35.1