Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp5584756img; Wed, 27 Mar 2019 11:09:40 -0700 (PDT) X-Google-Smtp-Source: APXvYqzTF1Vna8MVOe6wpCUVtYzGDXkA0JlF7xvRO2S01QCNkaMpIN0a3G1WB87LeoCjDFfheneE X-Received: by 2002:a63:e445:: with SMTP id i5mr5378948pgk.383.1553710180496; Wed, 27 Mar 2019 11:09:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553710180; cv=none; d=google.com; s=arc-20160816; b=u7yhOM6NJEL56rqdbPpqbqOj04DdZBf/zsV30ufvjEnKkmpVm8jpT9VbuN5nepvQKS S8TziNSW4lSaTS2GWkVrMLQ8Q204NmqrG/i+cusrvAhknHO3YexGYV6UQrr9T6g4QwQ3 2jbnxGDYMWeAGDB1/GIJINSnWDs57Y3JM7eHRkoPcx4hlO0OF3jr3io7/ftghRdgWR2c Z+g7eixoVk6q17rDVZQf7yCo3CiDX2RfpL83ooGvwdI5XuPI2cRbqhzGnz7iT0wCkqG+ a0q0xB+YpXOkqW3G/e78MhLQqy489725WGYDrm9WQUlCokn5TeeunHhsRX7BZgJRqfFf 2h/w== 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=eU5qDKbL4qX2P8uFVpQTyaLYAZS5E4uGoHi9Zot+PeckRkC9cjO1X5uTxgnjq2Dk+f MbXniManeEWOndS3z3PPPzAHwXAzOsRk7vrAqesRRNsMvSh0fDsBOFZ0UH0SaMYk7T8y ME2tJKd3m4BtSGtpYgqiycR6111nn69LWHJbl6tXbtanmk6l2nDenT6R4kXZ0O/YPrMZ VgCVcEk4QgHOsiTWt7W7eI/gHSkhuG4wpUfWKVQDTjHXapCp/W/OdgdNK1qiYWnrTu2h ig1HzxzlOPdF/HGduIC5vyrHH97DhUThFtKS2hMqKrYXSIrngvdoUn8pWIZwh1WtFT8R 19dg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=VT1pKcao; 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 v21si18707103pff.44.2019.03.27.11.09.24; Wed, 27 Mar 2019 11:09:40 -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=VT1pKcao; 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 S2387871AbfC0SIP (ORCPT + 99 others); Wed, 27 Mar 2019 14:08:15 -0400 Received: from mail.kernel.org ([198.145.29.99]:50112 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387844AbfC0SIL (ORCPT ); Wed, 27 Mar 2019 14:08:11 -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 A0D672183F; Wed, 27 Mar 2019 18:08:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1553710090; bh=d3T5jnxGDrJ1sLpQMQthl0IVFJCcODFk9WKpcP39bmM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=VT1pKcaoxv4boeyty3L5n4KwjQyUaIFyxOEowhUWumh6UvttPRpTHvmwpqu7tFFkQ lGyjDh586GNfWe+5XpYNaaFnqkP75yyhboRURAa8vJFBrbrMjMcq3y20Eo2nRqMtUQ mINjcVaEo1vJMfnIZjMPmGsKlKnuqS74axo6rDC4= 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 5.0 193/262] soc: qcom: gsbi: Fix error handling in gsbi_probe() Date: Wed, 27 Mar 2019 14:00:48 -0400 Message-Id: <20190327180158.10245-193-sashal@kernel.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190327180158.10245-1-sashal@kernel.org> References: <20190327180158.10245-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