Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp1023572yba; Thu, 4 Apr 2019 02:39:41 -0700 (PDT) X-Google-Smtp-Source: APXvYqz5Jl33UHHO4VEwCxHDrQYCEBr7Hn2jyQ2FXDRIB3VAzg3AYyVBECNTYWdnFW3pxQF7bNBz X-Received: by 2002:a63:8143:: with SMTP id t64mr4695329pgd.301.1554370781593; Thu, 04 Apr 2019 02:39:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554370781; cv=none; d=google.com; s=arc-20160816; b=KRdA06g0nVlEG9qFnj1XyC2QXU56Ofe8/CpTxtKKF1nufYje4W7F0PS+VrMCSg7W2B CiJNTLheoKx4KkCZKs+xQSF0hWm2F6uz6h0G8fQu71GPJqhBw81QfAxfTQcsm9UpTew+ yUQVfA9cNvs8pXczT0Yc6f9kBTc0ETOsfOZs3mKtTXwvVG8EzXqQZvQRjgsNHlJmDlU9 2Q8E38QywObD7onROLBiR5VDiz70uzisnNoglP6ELP44/pxsnoLIqPEDArPNlbhXq+tv jzfW1/SxaLtuMUaIR1ue1IuDNsoltbSgs39zdFGIPK6cevnsKgo0/Y0Gek7PLGjlBqNd pwig== 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=lmD4+jQLQTXZHw3jyF588b/QpUkq++lO05Ud7UF43Po=; b=guUzc6L2T+k+4/luQMcvZG+lriLNfEfHY56WS/f1xQj4m4467uAr/i6p5eT41aPjGE L2/2oy32G23ZH28rHZiT1Kn47BQwy3+b6/tJbxUyc45B8bFcd5J6bk+D0euCcuqgMIw4 yFhk7hBSyR3A++mjgO47bgG3FJ2T5W8GMqy9uIc4U0Qz3cLlrqx37iXn1gpQtJgRTpnS J2JY/y4IMv137sEulVzLMIIAzg1UXvbUa0UAK973Y9LK2HhDyC2pXMh5SwVO0PIU/WZF ZZzHhZMle9H06+P5aUD3qEKocUvtQ6e2DcoEfG59OoNWiILbrAI5Un49hH36Q/kebOZ1 R4FQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=y21JHzCv; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 73si16155554pld.156.2019.04.04.02.39.26; Thu, 04 Apr 2019 02:39:41 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=y21JHzCv; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731859AbfDDJFG (ORCPT + 99 others); Thu, 4 Apr 2019 05:05:06 -0400 Received: from mail.kernel.org ([198.145.29.99]:43072 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727525AbfDDJFE (ORCPT ); Thu, 4 Apr 2019 05:05:04 -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 4D8D32177E; Thu, 4 Apr 2019 09:05:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1554368703; bh=fperMca8X9y+RuhVlWfPNVHQgXhrUvnYR+6dxBKry8s=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=y21JHzCvX+UmvT1vQprRbYXrx7ulj6l+YFa2s3hPNB/Sxp/iNs7kWZ6v3AQK2/w0w aPfyJiZ9vUEHMw+A4G2aUmYhod0tHGVMylAEjTSS2Y70lLenqwGRY/XQt4MdiEPUXz zvbTVBvj+KiE418pk1/rLiP7bysAzbNRhQs+5yrQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Alexey Khoroshilov , Bjorn Andersson , Andy Gross , Sasha Levin Subject: [PATCH 4.19 138/187] soc: qcom: gsbi: Fix error handling in gsbi_probe() Date: Thu, 4 Apr 2019 10:47:55 +0200 Message-Id: <20190404084609.695941782@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190404084603.119654039@linuxfoundation.org> References: <20190404084603.119654039@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review X-Patchwork-Hint: ignore 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 4.19-stable review patch. If anyone has any objections, please let me know. ------------------ [ Upstream commit 8cd09a3dd3e176c62da67efcd477a44a8d87185e ] If of_platform_populate() fails in gsbi_probe(), gsbi->hclk is left undisabled. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov Signed-off-by: Bjorn Andersson Signed-off-by: Andy Gross Signed-off-by: Sasha Levin --- drivers/soc/qcom/qcom_gsbi.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/soc/qcom/qcom_gsbi.c b/drivers/soc/qcom/qcom_gsbi.c index 09c669e70d63..038abc377fdb 100644 --- a/drivers/soc/qcom/qcom_gsbi.c +++ b/drivers/soc/qcom/qcom_gsbi.c @@ -138,7 +138,7 @@ static int gsbi_probe(struct platform_device *pdev) struct resource *res; void __iomem *base; struct gsbi_info *gsbi; - int i; + int i, ret; u32 mask, gsbi_num; const struct crci_config *config = NULL; @@ -221,7 +221,10 @@ static int gsbi_probe(struct platform_device *pdev) platform_set_drvdata(pdev, gsbi); - return of_platform_populate(node, NULL, NULL, &pdev->dev); + ret = of_platform_populate(node, NULL, NULL, &pdev->dev); + if (ret) + clk_disable_unprepare(gsbi->hclk); + return ret; } static int gsbi_remove(struct platform_device *pdev) -- 2.19.1