Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3694089pxb; Mon, 24 Jan 2022 15:33:57 -0800 (PST) X-Google-Smtp-Source: ABdhPJzdPKYfiyGDag7T/flFW3mZfMrANZs2HyN3IXtUFOf2r7lg1iqJy4SC/W/K7qQp0XTmXO4U X-Received: by 2002:a17:902:7809:b0:14a:ef13:d775 with SMTP id p9-20020a170902780900b0014aef13d775mr16331086pll.137.1643067236813; Mon, 24 Jan 2022 15:33:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643067236; cv=none; d=google.com; s=arc-20160816; b=TSL9haBKrIqUq8lm8iSTSKlX2+cgErrsGv4/Us/ON3P0EVF8zAsZYRxz6WIyrYLHgH GUofJOcRXEdA2nrHdD1lmKo+hJ7LthwCFTtfQzXQqLkR11zu/tW8VFPh/06TT8DnKvDY pXqWnf90xR3vVlYRlyPuMysBSQTd39857/g8Y65cibuzb9raFUBWZxbdph4u1TghNLAv wqXIbZxDSX4B1IcdPlI4eqFCDxF/9b16lOJAA0ePF1o6nuK0w1Qi7ETkXlhnr9XLlBtH Cx/UVjf1HwDD9h6SV9wWvWGJVB1CEy9XjQojIsGpH62nrdooRybP7LPKsAdTdIVYa8cz SHLQ== 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=hZumrvTYPplnMzUn3ONtcQpWLYVFZZcHe+dZ9W/1TPg=; b=Ry/2j1kdMINHFMnusQXNaaC8UD9RhkDuHFrXK5ccx5goZoLIz5vPId7XEhGGo8j/YC KxCoIGkyfgdukCkDrfx6rIpHRa6ReEwU5BoeUVaIG8w6UEahj+BjhtVKSK/dk9y67Fqd 8bQ6x7P/ph/IXNjkznVh/p2l8eINBJqVgR2H2sEncN+HFGm9P5QRWGMq7KBcXFPXwCFY xCPK2YVzv8xuwQS6PoUwJHxDQLgQDVGc9tjpL/4awL6PvRhwAP+1eQE5k0Z9SBuXC9cy Gk/JCaHdwN3ALjT8c/Ij/cQGmxBgogW/LaXPv9UFJe6ww4dV/Jj7b1SZ80CSMQFy2FQF ymLg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=HlH1MudM; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g127si14538202pgc.526.2022.01.24.15.33.30; Mon, 24 Jan 2022 15:33:56 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=HlH1MudM; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S1579859AbiAXX1r (ORCPT + 99 others); Mon, 24 Jan 2022 18:27:47 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35708 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1579414AbiAXWNU (ORCPT ); Mon, 24 Jan 2022 17:13:20 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E9906C0E03F8; Mon, 24 Jan 2022 12:44:01 -0800 (PST) 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 5159860B2C; Mon, 24 Jan 2022 20:44:01 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 21E6CC340E5; Mon, 24 Jan 2022 20:43:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1643057040; bh=JiOVbM2qS81Tf9TfdFeLSOmQd6su6h5Fdx5wlgaihSw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=HlH1MudMOosQ2suTA7HhWa+hlz5xrXvN8FGw9ZMgIx3XldbyGvmB+97XTRZ25297o 4J0/bYeWq0hP7Qv3EDbqQdfU86Hj2E2LH7ifvGoYrdEWB9KK+dHlyTNMMXLQeOWQcu Kb4BMqnZaqtxhZ2C3VMH9kjn9MdewpRG7s2CAsc8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Zeal Robot , Ye Guojin , Thomas Bogendoerfer , Sasha Levin Subject: [PATCH 5.15 650/846] MIPS: OCTEON: add put_device() after of_find_device_by_node() Date: Mon, 24 Jan 2022 19:42:47 +0100 Message-Id: <20220124184123.454434658@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220124184100.867127425@linuxfoundation.org> References: <20220124184100.867127425@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Ye Guojin [ Upstream commit 858779df1c0787d3fec827fb705708df9ebdb15b ] This was found by coccicheck: ./arch/mips/cavium-octeon/octeon-platform.c, 332, 1-7, ERROR missing put_device; call of_find_device_by_node on line 324, but without a corresponding object release within this function. ./arch/mips/cavium-octeon/octeon-platform.c, 395, 1-7, ERROR missing put_device; call of_find_device_by_node on line 387, but without a corresponding object release within this function. ./arch/mips/cavium-octeon/octeon-usb.c, 512, 3-9, ERROR missing put_device; call of_find_device_by_node on line 515, but without a corresponding object release within this function. ./arch/mips/cavium-octeon/octeon-usb.c, 543, 1-7, ERROR missing put_device; call of_find_device_by_node on line 515, but without a corresponding object release within this function. Reported-by: Zeal Robot Signed-off-by: Ye Guojin Signed-off-by: Thomas Bogendoerfer Signed-off-by: Sasha Levin --- arch/mips/cavium-octeon/octeon-platform.c | 2 ++ arch/mips/cavium-octeon/octeon-usb.c | 1 + 2 files changed, 3 insertions(+) diff --git a/arch/mips/cavium-octeon/octeon-platform.c b/arch/mips/cavium-octeon/octeon-platform.c index d56e9b9d2e434..a994022e32c9f 100644 --- a/arch/mips/cavium-octeon/octeon-platform.c +++ b/arch/mips/cavium-octeon/octeon-platform.c @@ -328,6 +328,7 @@ static int __init octeon_ehci_device_init(void) pd->dev.platform_data = &octeon_ehci_pdata; octeon_ehci_hw_start(&pd->dev); + put_device(&pd->dev); return ret; } @@ -391,6 +392,7 @@ static int __init octeon_ohci_device_init(void) pd->dev.platform_data = &octeon_ohci_pdata; octeon_ohci_hw_start(&pd->dev); + put_device(&pd->dev); return ret; } diff --git a/arch/mips/cavium-octeon/octeon-usb.c b/arch/mips/cavium-octeon/octeon-usb.c index 6e4d3619137af..4df919d26b082 100644 --- a/arch/mips/cavium-octeon/octeon-usb.c +++ b/arch/mips/cavium-octeon/octeon-usb.c @@ -537,6 +537,7 @@ static int __init dwc3_octeon_device_init(void) devm_iounmap(&pdev->dev, base); devm_release_mem_region(&pdev->dev, res->start, resource_size(res)); + put_device(&pdev->dev); } } while (node != NULL); -- 2.34.1