Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3578249pxb; Mon, 24 Jan 2022 12:40:14 -0800 (PST) X-Google-Smtp-Source: ABdhPJxLCEccGoMWiM5zsmY90HuA5t7JolgHuv/5cD7PnPS3l1p45VqER2OFydVUQIq/Oa8e0zWv X-Received: by 2002:a17:90b:224a:: with SMTP id hk10mr23667pjb.89.1643056814647; Mon, 24 Jan 2022 12:40:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643056814; cv=none; d=google.com; s=arc-20160816; b=nuAxYMm9sdY3TMQdfGh4Uts6LLGgp3Xegul5VAclzuBl+PsQ7T4anufz9I/QqeaZTJ HA65X3VKZx1Zoy89w2DJlh7wHowjS9N5kbUp5yzfYV6p0HfUoR4v2NGDNx7xAuFV2LAA Y75LrGYM86Z+haMGAazULzqy6ZONHMwP8uuBqgvxUiQbC10JyTYXEJ0QzM469zOlOOiH WUbLDkjMKSvk3pIABaRjLnMiy4Ll3ws5Vz0Fb5R6LGu41iAd5yx6ro/WmcthZm8aluwi nE5edvnZNgXOlLbhGqqrX7fewlJ8vf5pMRuEBrmyVSrmeNudXBheIOmSWMbvtUHM/oVG eVWw== 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=MOb0x6LW07B0STuWlqeaNzPvaVLNc62lrl/IKdbys2o=; b=i2X+V5Y21eTPbZfNdw259oSyoN4ScaX4EbvtZ8qGKm+SHsYKMzNX6bhgoiildc7Zx3 G1T5S6XhaMlgSQdJb4wVs0MXnA8uEO8CJb7/j9uoOETxtME8NpBwV0WrEv8hjn4FvVtc Z+CqXbmeeEOV9V4Okjk6aTm0h08P0CXWUuPBypE72LIQT0KCQ8wt0Pd+ILQ3i5svQ3Sh lK+pVCUzX25KGI/riDKE8cLZjYEh3/07ImN65u+dBdYz0Rm53bRFDxCXIA+qo5k3dCzD rUP5g3EmaDzd+2nFvFP92QwEhBlBRJT+7ArQJy/pAsEuUW6VGSPay/35tHp9NG16vNyM 0zYw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=joy4VfxC; 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 x9si15218827plg.164.2022.01.24.12.39.55; Mon, 24 Jan 2022 12:40:14 -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=joy4VfxC; 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 S1352571AbiAXTw6 (ORCPT + 99 others); Mon, 24 Jan 2022 14:52:58 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55008 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234964AbiAXTmC (ORCPT ); Mon, 24 Jan 2022 14:42:02 -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 93EF4C0401F9; Mon, 24 Jan 2022 11:21:40 -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 504B9B8122C; Mon, 24 Jan 2022 19:21:39 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5EC7DC340E5; Mon, 24 Jan 2022 19:21:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1643052098; bh=9uuTNGN4fd8TIPEbjUjg8u469Jw6qL+92O7t1DCz5R4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=joy4VfxCgwXNO5CKZ3PEVyOgDrHjzP0SWn1jc79vdMbZou66o8UbZeG6LrWJtBREz vv+bTAT1GVLWJZo2zr11ssBFNE7ogCKCp8n8ZLQqTucS1ZAbp+4yoZ5bCUUJYcqk2V pE3bcNUfWqougSF7MxdxypuZzbUyXrmCCA7wUljA= 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.19 189/239] MIPS: OCTEON: add put_device() after of_find_device_by_node() Date: Mon, 24 Jan 2022 19:43:47 +0100 Message-Id: <20220124183949.123070769@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220124183943.102762895@linuxfoundation.org> References: <20220124183943.102762895@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 5ba181e87d2c1..4d83f5bc7211c 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