Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp2638517pxa; Mon, 17 Aug 2020 15:09:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwowD2XV32/EqYp1YCZ2SbCBG/pCnUckRQYC4RxpEkZMZfkibZyZEt9VsJjNKI75/lpjFxu X-Received: by 2002:a17:907:2067:: with SMTP id qp7mr16820537ejb.378.1597702165015; Mon, 17 Aug 2020 15:09:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597702165; cv=none; d=google.com; s=arc-20160816; b=u61sZFMZxKYUwO6dls+jhIEuk8SINOhsG/fdfh5v3TWbBvVHM+kJmYQ76Hcm4Q/nkR FgkPabJUB9CPFV7DANQhUekH2grqalLFz9ONNAGED+2MmyZAnwon+/ryrOQGStD1Ckm5 IEmCDQdevQlGO+rjWeQtmyDLxuUvXYUt5DsgSAM7kNz/hWvZP9YM1Bl8ADkoQVaAwc3s Q9VoRDoTrUuYvzkUPBtho8dGjQevVbXg8fucnfkUf5Yiir55ozwZ1kVK4/kZtEgcc3S1 jSJh3wQrfxfY9cEM1EmnxLJydbVYBR9Bg6rq6wWlRFnZW8Lk/fzGjUj6XnoztTD1qLhH 9z1A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=A5sZPzs/RfK7AWeHc3xYDQ/PQPqLDdL/Qz36W80+PrE=; b=ICEcFwS2s3aRREshXGmovW1Miv74LfxRaiZFvsvC5b73ucSF/Tg+8pIXT+lMM3z5ys jy5U+3L62//wkQq91ble+ngvTWNS1sPd+c25NW5lBGV91FC6kNg1Zhf0bvDC0FC9TE5f csph/UDyRRHCtekmEfnAST/RBaoicAhvy8KR+TZx3NMTPSOXkzpa/fbs6Gmx2+FVj+nj BlupRKAV/ERCEFW1h9g6qWmDXeC+iqi89dYu3apphP+VWZ+fJroRk5D24ezJyZzFX1Cy ZGP1twUBVxjm2bYWCaglDE8zqRRWh1coI3OYqhkysfOcTLwlWX2GcGKdTECsvvr3SZ7w cc8w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=cNOp62eH; 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=fail (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 g12si12336514ejr.622.2020.08.17.15.09.01; Mon, 17 Aug 2020 15:09:25 -0700 (PDT) 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=@kernel.org header.s=default header.b=cNOp62eH; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388514AbgHQQ1G (ORCPT + 99 others); Mon, 17 Aug 2020 12:27:06 -0400 Received: from mail.kernel.org ([198.145.29.99]:37902 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387832AbgHQPwG (ORCPT ); Mon, 17 Aug 2020 11:52:06 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id E56AB20657; Mon, 17 Aug 2020 15:52:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1597679525; bh=zfTbdVOfDIBpKELnc64oGWyDb5AwND2CYHOdFudtnok=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=cNOp62eH+ZKahuGtVTZh3qhF6qNCspYXHGsrnZr6T15cRIU87+HK4jC0YRkAm5uYj KZ8wrUttp4c9YAc0IeZh9IFWWaWgqxw4nCH37QRYsE6gC3hZN/tUcyQdOthoQNW6mD 3ShF4L+riQqeLH4alnUZUqLB977tqmBixOktibBs= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Yu Kuai , Thomas Bogendoerfer , Sasha Levin Subject: [PATCH 5.7 242/393] MIPS: OCTEON: add missing put_device() call in dwc3_octeon_device_init() Date: Mon, 17 Aug 2020 17:14:52 +0200 Message-Id: <20200817143831.358053883@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200817143819.579311991@linuxfoundation.org> References: <20200817143819.579311991@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Yu Kuai [ Upstream commit e8b9fc10f2615b9a525fce56981e40b489528355 ] if of_find_device_by_node() succeed, dwc3_octeon_device_init() doesn't have a corresponding put_device(). Thus add put_device() to fix the exception handling for this function implementation. Fixes: 93e502b3c2d4 ("MIPS: OCTEON: Platform support for OCTEON III USB controller") Signed-off-by: Yu Kuai Signed-off-by: Thomas Bogendoerfer Signed-off-by: Sasha Levin --- arch/mips/cavium-octeon/octeon-usb.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/arch/mips/cavium-octeon/octeon-usb.c b/arch/mips/cavium-octeon/octeon-usb.c index cc88a08bc1f73..4017398519cf9 100644 --- a/arch/mips/cavium-octeon/octeon-usb.c +++ b/arch/mips/cavium-octeon/octeon-usb.c @@ -518,6 +518,7 @@ static int __init dwc3_octeon_device_init(void) res = platform_get_resource(pdev, IORESOURCE_MEM, 0); if (res == NULL) { + put_device(&pdev->dev); dev_err(&pdev->dev, "No memory resources\n"); return -ENXIO; } @@ -529,8 +530,10 @@ static int __init dwc3_octeon_device_init(void) * know the difference. */ base = devm_ioremap_resource(&pdev->dev, res); - if (IS_ERR(base)) + if (IS_ERR(base)) { + put_device(&pdev->dev); return PTR_ERR(base); + } mutex_lock(&dwc3_octeon_clocks_mutex); dwc3_octeon_clocks_start(&pdev->dev, (u64)base); -- 2.25.1