Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp9039542pxu; Mon, 28 Dec 2020 05:09:12 -0800 (PST) X-Google-Smtp-Source: ABdhPJyxzv16Sg4N+ikp26u90Urd8Mh/Sofjw6VZBOPcLl8WupXFsaoBJUQjK3lHUbJXgZmHqaYp X-Received: by 2002:a05:6402:1d0f:: with SMTP id dg15mr34863646edb.1.1609160951893; Mon, 28 Dec 2020 05:09:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609160951; cv=none; d=google.com; s=arc-20160816; b=CPO2j7VR6mphsX2IkhMlI4g8ZKmWFZd7qAVeDldg501EhKGqbD8IoSYGyNST/b4+FD WJz2CnrGGGNI9RFzOeHhfVFsfC0l9noAHV3mUHmQN85kCBF7EGTvhq1olN1tCjSaDlfK vTmT5NzhjSvAhX2vc6Nl7dOUtUO5SLwUHZ5lJ77AiZQFFiubl8ypkjs+cO2K21k5gnA/ OevgPxW7h2z5DZAT95Zjg7m2cDOYKMYREF989jmJnLrQbOYJNXBwUGlszX7IXCbo+pAU FSWHBeNGb2zHOVrY/XuFl3RWl0aOmisZope8/3NlyjTThJ8qYmqcs4czunTiUFxFkZGg waDA== 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=7agZK0zkwRnqKl0sfY1Hyt3AaMjd7IocLXhUT2vhJMc=; b=jGU1MSb/RSBRkz0OhPNRA3oDj5mV+KMUxsEh1N1VwpWeJXJ3y7reKisDYDHSbiewmc mWfsH3oHQLSLaXtgxce5f0oyLKr3VF9+AVLT1NE6P/2XhL30qrLGnT5SzAnxZxDwyEXC znosM9MsChKHGCOtQ84GsqGExoyfDl8m88gTj3XdylgHKEbGVGsSq4NpsdllnPx6RNBQ wwLh5GPnMz8EdTSlGVcSRgNJZutZzm7pH+KXDJdinxEpuYx/6rXRjh6WTmmsWlENhJHQ T2jWorehZQwBjmN5U5+1FWSnXO5lgyVTmB82Rg277Cw5sqA949DIL5/9BWTysc2NNxb8 IQbQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Hb1oX+oW; 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 ch18si18874580ejb.736.2020.12.28.05.08.48; Mon, 28 Dec 2020 05:09:11 -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=Hb1oX+oW; 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 S1730561AbgL1NFJ (ORCPT + 99 others); Mon, 28 Dec 2020 08:05:09 -0500 Received: from mail.kernel.org ([198.145.29.99]:32774 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730517AbgL1NEv (ORCPT ); Mon, 28 Dec 2020 08:04:51 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id C25FE22A84; Mon, 28 Dec 2020 13:04:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1609160650; bh=GF3KQyN3rtuUpoa7lKZkvuJXX0pYjjNIGaempjK5EbM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Hb1oX+oWeUxTBGvAJ46WSEhoJooUqxLUudItOYni5LY8ulNO5tUTgCWRiucMT4+Bg LhsZD6cZQ1YBVitUfFAv5+I8PVRKNARZi8ktbei8ZwYAya5zISAo21AZghtwFlC4iP nm51ajn2oyL1YjNnY2bh1FpU94HjrNdAlxESoRNc= 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.9 093/175] pinctrl: falcon: add missing put_device() call in pinctrl_falcon_probe() Date: Mon, 28 Dec 2020 13:49:06 +0100 Message-Id: <20201228124857.754597996@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201228124853.216621466@linuxfoundation.org> References: <20201228124853.216621466@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 0b0fc2eb48e0b..adcdb0585d398 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