Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp5613376img; Wed, 27 Mar 2019 11:43:24 -0700 (PDT) X-Google-Smtp-Source: APXvYqwdVtT1joadHKXFQL+nbPVtntups7GMrBMDdXqtCCeR2Yme8opc3J6p4ndEmK08shD51co0 X-Received: by 2002:a63:6fcd:: with SMTP id k196mr23805910pgc.238.1553712204064; Wed, 27 Mar 2019 11:43:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553712204; cv=none; d=google.com; s=arc-20160816; b=WjuzcU1OTRnDBilkhLbQsuH23N1hgo8acs91jidNUBNTSuoxl58ER2NL0/itAevs8N rNApYZbRl/RbQ7K9sR7JIeBwQbn0RssdP3Wc8m6EH64wGseuTdHeQXMoOlTCPpH4iE2M BEkAxrPRM+S27MbBAvYulR4zDTbD2swPhfSHfrh/26Li7ec21ZwQKASXZGysrKalQC3L lJdFTmvlRvhJkYEvCIJLOk5wTE6F6ZENku134HFzQrWMcYtWOISpXTnRcuRmHDSzIW5D g1Th013OBy8u6RYDiQ3+Pk0uWKYOa9foZcgneHsR76VQxVCPEB+7Upy+uWbUArQrmSb2 DdSg== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=t4EgVtbF0Y3EUXBGT97CPhzwlDosFX3l3puU2uITIIs=; b=snAPPSgb1JVBbMi/fUDlTEwfTwinioOh2G0vPb3mr3uZLZYr8nTSsmLHpXVjqMPNTx YCkLooSAoZWqDtnhA7+I8C0fyLhe7PlLSuC3VwdRFmEG/q9M9r6anYDNVHv1Vjy7j7Lf pmABjqGEFKEQgCHP/zr56plmCqw9lQF6cJo9NCP2x/x3dhNGym/GcTjs6fX8EzYiKIyf AcwNZVJ1xbp+/85e1qpTZ+0ylyvFnlhni59yTkQmsUMPS8+/se23VjgPT4IZH5Xx5Ht/ BDeHmLTgLE/Kz8UKoUyI8TXq1J1g4efTZIU8kLiTkPp1JaAMJFZWfuYNV6nvxYRwoFPO iMKw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=lSAhoZ5B; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 31si21002138plc.190.2019.03.27.11.43.08; Wed, 27 Mar 2019 11:43:24 -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=lSAhoZ5B; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2391532AbfC0SlO (ORCPT + 99 others); Wed, 27 Mar 2019 14:41:14 -0400 Received: from mail.kernel.org ([198.145.29.99]:40766 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2391305AbfC0SWf (ORCPT ); Wed, 27 Mar 2019 14:22:35 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id EC7FD20643; Wed, 27 Mar 2019 18:22:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1553710954; bh=d3T5jnxGDrJ1sLpQMQthl0IVFJCcODFk9WKpcP39bmM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=lSAhoZ5ByW9s7pbQKfTTNij+nlcQ3zYyEWHYD+mkYx+XMmhtNEZUP4ZOri14Xeief uSwhs1smcEzlmmx9wK0AfHmJ8u4D1HjlIFQOswWfy2FmJY81334rGXcxSeIg9TgNfz pSw8qOpClzSzSztBLdCM6fDzbJiCpeG1CCQGiG8g= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Alexey Khoroshilov , Bjorn Andersson , Andy Gross , Sasha Levin , linux-arm-msm@vger.kernel.org Subject: [PATCH AUTOSEL 4.9 64/87] soc: qcom: gsbi: Fix error handling in gsbi_probe() Date: Wed, 27 Mar 2019 14:20:17 -0400 Message-Id: <20190327182040.17444-64-sashal@kernel.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190327182040.17444-1-sashal@kernel.org> References: <20190327182040.17444-1-sashal@kernel.org> MIME-Version: 1.0 X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Alexey Khoroshilov [ 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