Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp9085274pxu; Mon, 28 Dec 2020 06:16:35 -0800 (PST) X-Google-Smtp-Source: ABdhPJwH3vsRQve6OfBGNbrjKgXqKFMwL7bvpFJ2NS/mTxFu0cJmA2JSRZ5/0+or3TjWPlDvj/Uo X-Received: by 2002:a17:906:a011:: with SMTP id p17mr41181224ejy.30.1609164994818; Mon, 28 Dec 2020 06:16:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609164994; cv=none; d=google.com; s=arc-20160816; b=W9nnTYkr3VW0WfC/yagr8KYo/G7N2RX1lEmNcfQg8umXXRUDmmEF1k0iD5chcvXNPY KppyzZxsqc6GGHYuOajOXC2IGGaDRVOiiJR7ZmcP/B9gSFxKbCgYMFIoOOHRrGOaFSDX XLlkWd9HKmFVtMh3VEO4xnp5sfm4prCouyAkfpW2c/zh23u8Oh2xxPAChBoUkMgw4MY5 1PIlJXEnMXPyVuY96ey2LsX56RS+eJIWxfPuqa+AcZt8mihpu9wb4XtQDfAYFeHlCStw DQsftvJ4nW3sIUfP97EjcpQUe/dCmMPwZpEcSlESoVhXB8PfaQw5jiQTAv0pSKOqILHn 4CqQ== 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=WYEKupJ6KQP5sXAehEnuZEGs+L4l4xmOfoIO3Pru8dg=; b=qDOtjyBJl5H4jcQDScMImnux0fyphBW8AFrSAdBt7zbz22QqCWh3KUfWSIAu34gXVe bFEBNZW+XxEysqZIjMCBJwAH5scOPGl+skDKOVn421qJ6Tk4wicP1nbUbT1gdP/Oxwtz GQyEavcV0UUD8Va/032XIkbcTjLtWvJuIpPt4N6YHdC3cKwFYLu6Luoq7q1BAJY2sllU 1zqtLwn9PD5pZx9+eqlVnn1BTFWUzmdbFOEB8Iev6+w+5phbd4gtr2XuLkNg30ZitJQz v6CyjKeJPR0Oi2uTaPlMnvWrzpDrhkqdzyC0v7v2L5v7eN3tHXz1hOZAQz012liN4cKV 7yvg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=aT7NlaLI; 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 z5si18928639ejj.549.2020.12.28.06.16.12; Mon, 28 Dec 2020 06:16:34 -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=aT7NlaLI; 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 S2440279AbgL1ONy (ORCPT + 99 others); Mon, 28 Dec 2020 09:13:54 -0500 Received: from mail.kernel.org ([198.145.29.99]:48644 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2440248AbgL1ONq (ORCPT ); Mon, 28 Dec 2020 09:13:46 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id E206D2063A; Mon, 28 Dec 2020 14:13:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1609164785; bh=7QYv8oJtyx/FMSfi9dcyS8Tpx2rmOdUqHgJGIugiPC0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=aT7NlaLIvVwpDiDSOeRuU1lYD858s+21if1RBipeC+ev7wPyfyer8g3BK69r9pjEA j6pKZ/SLHMRZMB+2kUhn8EQf7rHhqjjJ0StbuD6oERs+9+TbGobrwn26fGBOYEotgi juRCE9LDD1E/xLt7AwdbWr5DGraeyscDWg1bkX28= 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 5.10 297/717] pinctrl: falcon: add missing put_device() call in pinctrl_falcon_probe() Date: Mon, 28 Dec 2020 13:44:55 +0100 Message-Id: <20201228125035.255640856@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201228125020.963311703@linuxfoundation.org> References: <20201228125020.963311703@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 62c02b969327f..7521a924dffb0 100644 --- a/drivers/pinctrl/pinctrl-falcon.c +++ b/drivers/pinctrl/pinctrl-falcon.c @@ -431,24 +431,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"); of_node_put(np); -- 2.27.0