Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp9225554pxu; Mon, 28 Dec 2020 09:47:21 -0800 (PST) X-Google-Smtp-Source: ABdhPJzytAuhl3kgj0Ccn4B+9lbWbIohVZC7Bemy2S6NApDBZWsdiG3qpOwLBaZ2ScLrmnpVV3IX X-Received: by 2002:a17:906:386:: with SMTP id b6mr28160201eja.554.1609177640894; Mon, 28 Dec 2020 09:47:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609177640; cv=none; d=google.com; s=arc-20160816; b=Z5hvp/hitN0gmIY3sWaxuUj4hFSlbrROd9vU2bZOmxSuIRyeA1gQNqK7rrjVf93WH6 3cE1N8aBdCEqCGjWaN8VC6s9vHJjOY5b7nLiqU6v9w7QG9ZBXDQJGeLiDKRKEyz9HPQI 9dskVtZeUNoLvXDtuYIml9OyYPrilEbkCgDKE5DSwGuEFTxLi2TNY9+y8+bOq47hw4D4 QFZ5dGBTGnWsoh6n923Xnn3jeK+UM77zEqCoOxVeAiUn+DWgcRZKtOKOfAm/ATq2j0/7 yqT+5h4mzdpbsaO6lUwURRKQSUrpLkgJsdYOyl2svnHyAPwlAkvUIUMLNV4UE/jLlYhz oRHA== 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=q7u6bWWBODYIjzGyy3KaxAsmqpkHfiR9waertMN/qvY=; b=l5FFHsJqx5/4/qAyzu+EbK6BQ8uwuuivmlRYr0AKt8iMMdplYq0XFAXwsR23W6wsnk iFP1sP9C3xzX2u0mUq9cnkpxCYBCugi/j1OBOp69zwrFONuqDr82DoFDrD6UfFaFiWxy eqiw02x3bjOvNuoeN6SRk7yX9o+3dw/gAaT348hRPAXeRKrOJKWU8epJHaodndsgQbyO Ba/8aYSMv/WTWnNOczsv5KRu8gMvwlURQpXtreMdLafGgVFyMW+FgsXseLjsGa64y/hJ IkPpyNtmP7M97+f2wssBx9nCRxCFR92ZiEFtGDc2DBo/CkIxaA+Zxv0w6vKcDxo/XeY3 z0nw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=d8SsbLV0; 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 l8si18379121ejx.605.2020.12.28.09.46.59; Mon, 28 Dec 2020 09:47:20 -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=d8SsbLV0; 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 S1732335AbgL1NNy (ORCPT + 99 others); Mon, 28 Dec 2020 08:13:54 -0500 Received: from mail.kernel.org ([198.145.29.99]:41970 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732319AbgL1NNw (ORCPT ); Mon, 28 Dec 2020 08:13:52 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 5F20C22583; Mon, 28 Dec 2020 13:13:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1609161192; bh=Go5O+Ekl76VF6e9p5cmqsmgodlmRJ+kZfPXhZGg325Y=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=d8SsbLV0oYQg1Q0MQsoHtKyp6QF6LXppkzZ4Dhfgd3Gl6/8DHDdEVwsvICXxC62nZ 2bykk4IwHFiVZ2TdmvQNjhx5N255frwlQGAMkznbIpcTCZNxedVr7vCpAxjgpMe0Fv +7Z/bBO9d10gRv/2JnbJETkYHxJnf4vXyf3IxjKc= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Yu Kuai , Linus Walleij , Sasha Levin Subject: [PATCH 4.14 132/242] pinctrl: falcon: add missing put_device() call in pinctrl_falcon_probe() Date: Mon, 28 Dec 2020 13:48:57 +0100 Message-Id: <20201228124911.201300032@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201228124904.654293249@linuxfoundation.org> References: <20201228124904.654293249@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: Yu Kuai [ Upstream commit 89cce2b3f247a434ee174ab6803698041df98014 ] if of_find_device_by_node() succeed, pinctrl_falcon_probe() doesn't have a corresponding put_device(). Thus add put_device() to fix the exception handling for this function implementation. Fixes: e316cb2b16bb ("OF: pinctrl: MIPS: lantiq: adds support for FALCON SoC") Signed-off-by: Yu Kuai Link: https://lore.kernel.org/r/20201119011219.2248232-1-yukuai3@huawei.com Signed-off-by: Linus Walleij Signed-off-by: Sasha Levin --- drivers/pinctrl/pinctrl-falcon.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/drivers/pinctrl/pinctrl-falcon.c b/drivers/pinctrl/pinctrl-falcon.c index fb73dcbb5ef37..68dcf53aaac34 100644 --- a/drivers/pinctrl/pinctrl-falcon.c +++ b/drivers/pinctrl/pinctrl-falcon.c @@ -438,24 +438,28 @@ static int pinctrl_falcon_probe(struct platform_device *pdev) /* load and remap the pad resources of the different banks */ for_each_compatible_node(np, NULL, "lantiq,pad-falcon") { - struct platform_device *ppdev = of_find_device_by_node(np); const __be32 *bank = of_get_property(np, "lantiq,bank", NULL); struct resource res; + struct platform_device *ppdev; u32 avail; int pins; if (!of_device_is_available(np)) continue; - if (!ppdev) { - dev_err(&pdev->dev, "failed to find pad pdev\n"); - continue; - } if (!bank || *bank >= PORTS) continue; if (of_address_to_resource(np, 0, &res)) continue; + + ppdev = of_find_device_by_node(np); + if (!ppdev) { + dev_err(&pdev->dev, "failed to find pad pdev\n"); + continue; + } + falcon_info.clk[*bank] = clk_get(&ppdev->dev, NULL); + put_device(&ppdev->dev); if (IS_ERR(falcon_info.clk[*bank])) { dev_err(&ppdev->dev, "failed to get clock\n"); return PTR_ERR(falcon_info.clk[*bank]); -- 2.27.0