Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3563301pxb; Mon, 24 Jan 2022 12:17:53 -0800 (PST) X-Google-Smtp-Source: ABdhPJz/HUbf/V/I93DaFZJR95ErIL+d3U0WEbV2n1GUk7BnXwg3obWZBLgiWYawpm9+alpTzzoH X-Received: by 2002:a62:848b:0:b0:4c0:a0e:f9e8 with SMTP id k133-20020a62848b000000b004c00a0ef9e8mr15355364pfd.39.1643055473135; Mon, 24 Jan 2022 12:17:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643055473; cv=none; d=google.com; s=arc-20160816; b=ViWwdIFI9vb/CWKKDfLKJAov5wYg1sWLod7XlM6caV5xUybjr3dNuq4zHVHKl5YDd6 trYPboji+keGT0aeI0GpiypK5f6+ntFRbnxBtlNfGnABSiUIvtmIzIVBB23cRvo91t6W 6vkEVEtfByQmFmHtspSfVTbHQJT6d8l3VtX2aV3zPtw98PKdsXeUA6Dcc9zkxwpQ8BRA /UCzPz8vdkXTzm1iHb2u7+O+qisNAafrplq00/AVvw04gKU5XJRwYsRWqEP1wL7kslwp D01FrLO70/c9urtjBTIR9DcesINSS/6tGY7/jwEb7lOSuSRhsMlUgfuiadeoVBaXcYxv 8ynw== 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=Ca9JSB/+RDBfQBcIPmcWnhejuHlsxadExPw8v3QLY1k=; b=qUggSmpfovKLUSj74N6ZHmtIFFB9lVK+mpHn7lYG/w2RpBBVyLvRQBQ7uW05x5hhi+ PNQwpeSmQuAF8j/0VwjBfe6a018dUuVQBEf/L9/SCDrxwV9eHpaqjWz0N9ob7xQJb/Mg IiDHdAaEMvaDPz0BlM1e/PgpS9231WgXZf2YSZwVp7b5pZf8fwV8IFg1FZMiMQbqbnZ3 XyysfaXn500KYCS19yakdukm5/HPpy+VJ3oreObuL3YD6eeXR4lYb9TAOD0hGGRIXuuI 3hXAM9r4H6UlVQNQGJpu/qAi0tjLoz7sJTeq3jMse4C4I7eWEfx5NFkF6UTuMeh6y0s1 gT1w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=EbHcCYbK; 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 c22si13623907pls.184.2022.01.24.12.17.40; Mon, 24 Jan 2022 12:17:53 -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=EbHcCYbK; 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 S1349100AbiAXTUO (ORCPT + 99 others); Mon, 24 Jan 2022 14:20:14 -0500 Received: from dfw.source.kernel.org ([139.178.84.217]:41358 "EHLO dfw.source.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238472AbiAXTLs (ORCPT ); Mon, 24 Jan 2022 14:11:48 -0500 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 7CD5F6124E; Mon, 24 Jan 2022 19:11:48 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4AF3EC340E5; Mon, 24 Jan 2022 19:11:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1643051507; bh=BhvH5FYxPJNi12cUpjUBB71t6MBUCKzlBxAp22IT8s0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=EbHcCYbKg8eFahWRvxC5A1tgtV3/OcLX+8a8vbmEGkIW/VyhpucRzdEMwWNiUtTyw 2c1QsW39w/vfpym9nyydRTMWunyhpDmjhfTXClLdvcXPaot6MsSBdkPDkpzMv0S1Px heczi8I8QcqMz6rVyyZFOuAfAyjgud+uT28NzZ6Q= 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 4.14 142/186] MIPS: OCTEON: add put_device() after of_find_device_by_node() Date: Mon, 24 Jan 2022 19:43:37 +0100 Message-Id: <20220124183941.670941363@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220124183937.101330125@linuxfoundation.org> References: <20220124183937.101330125@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 e1e24118c169e..ed42fc27033c4 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 75189ff2f3c78..3465452e28195 100644 --- a/arch/mips/cavium-octeon/octeon-usb.c +++ b/arch/mips/cavium-octeon/octeon-usb.c @@ -543,6 +543,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