Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3982321pxb; Tue, 25 Jan 2022 00:37:13 -0800 (PST) X-Google-Smtp-Source: ABdhPJzktAF5b+EjenT5HB+Q87AZkkL0fsWmnDFb5X916ZXbqBiT14hZqXWnSsYKa4uUtibCsL0/ X-Received: by 2002:a05:6a00:2310:b0:4c3:d3e:3667 with SMTP id h16-20020a056a00231000b004c30d3e3667mr17777659pfh.69.1643099833764; Tue, 25 Jan 2022 00:37:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643099833; cv=none; d=google.com; s=arc-20160816; b=GUFdAanX34tQztNj7QAzDZjaMUp9oj3dlQDPd41x4W5L5LJBNzat/NyRO6VkJOX8dh MopjBcVNJRC8reYJzlf8ADLu86UoPgXlkcqrcyP6aYQ73HyIfhH4rSo7zK9Df25c1wIR ssJaBBU9PlDZG8AEG2twB+SgUYfAxs6OxBi0dOIAUrai5ngWhqKD+jPmQ9r9fJHVUMwY beceCtGQFcdeHO0mrXFnE7PEfELLnNC8jleI1ZTIPQupL+7Nh6Mn/NO3Is1W23BlRB8K MBdNa4uWfq5DAApy/iFk07Kfss0WPuK92ZOqsp3R7ctg9EuE3qt8F1VZjj5avm/n2hpg KF+Q== 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=JhvTnGcHCKzeDfONMBTs4twhEMj+ca7UQ87+32O1oTY=; b=aJwZDt20vxloELS0ZMpNh+cxkL9C9bM5LaWD2cmG4VF5iNwE1Jea5ybHmCuJts/YTw R3bHBa5/FWfbPD/KIEkT6ev41vVtIF0EMcKjI58/Vr57D4FTy4tjdRXkQ/Mol01z3Cj3 9t3yxhj3ZX6zP22Qpi06glxl82wy/GbosWlBzuj/tFsR7p0Tx1YvwIiD48fqBxfHl/7E 5UDbJSdbA6UQjJwFdxOb+B8neVdYaNkagAxuFTslxppRIQnY1kS/UcGiYrCZHB4RVwPX tG/vEDPKu5VRk1qFDM8Jlke08eEBGqejCz3aEcKLNet/YqdgEclJOb9VOYY9bV7Z/7ZO fV+A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=p8GcmPvc; 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 o12si14539698plg.212.2022.01.25.00.37.02; Tue, 25 Jan 2022 00:37:13 -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=p8GcmPvc; 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 S1314766AbiAYCvn (ORCPT + 99 others); Mon, 24 Jan 2022 21:51:43 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46598 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347065AbiAXVFL (ORCPT ); Mon, 24 Jan 2022 16:05:11 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 05737C055A94; Mon, 24 Jan 2022 12:04:31 -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 ams.source.kernel.org (Postfix) with ESMTPS id B6A13B811FB; Mon, 24 Jan 2022 20:04:29 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E21B9C340E5; Mon, 24 Jan 2022 20:04:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1643054668; bh=1W7QnzWemca3+VHrxEBDJsad3MM3/pf0E4IB4zUs6LA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=p8GcmPvcQA6sgSZ+00ofn+xjsHT7CIPoDKBnUZibiXyvmqOOXP/KHHFTtV2lex4cS u0T0mQubQYJ82mYLlwXpbTV8mIkQX4yLcivF9cVTOQPv/s8XlFey8KffBmqzqjrXwo nhKr6zPKsEi/b+YXcGJ3TtGkRHik64upYyq8ablU= 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.10 432/563] MIPS: OCTEON: add put_device() after of_find_device_by_node() Date: Mon, 24 Jan 2022 19:43:17 +0100 Message-Id: <20220124184039.394739063@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220124184024.407936072@linuxfoundation.org> References: <20220124184024.407936072@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 950e6c6e86297..fa87e5aa1811d 100644 --- a/arch/mips/cavium-octeon/octeon-usb.c +++ b/arch/mips/cavium-octeon/octeon-usb.c @@ -544,6 +544,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