From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754091AbdLGR4P (ORCPT ); Thu, 7 Dec 2017 12:56:15 -0500 Received: from fldsmtpe03.verizon.com ([140.108.26.142]:60661 "EHLO fldsmtpe03.verizon.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755891AbdLGPsp (ORCPT ); Thu, 7 Dec 2017 10:48:45 -0500 From: alexander.levin@verizon.com Cc: Alexey Khoroshilov , Lee Jones , alexander.levin@verizon.com X-Host: endeavour.tdc.vzwcorp.com To: "linux-kernel@vger.kernel.org" , "stable@vger.kernel.org" Subject: [PATCH AUTOSEL for 4.14 089/135] mfd: mxs-lradc: Fix error handling in mxs_lradc_probe() Thread-Topic: [PATCH AUTOSEL for 4.14 089/135] mfd: mxs-lradc: Fix error handling in mxs_lradc_probe() Thread-Index: AQHTb3J2uECmbTsGvEO01Kz9MqDEaw== Date: Thu, 7 Dec 2017 15:45:52 +0000 Message-ID: <20171207154513.4154-89-alexander.levin@verizon.com> References: <20171207154513.4154-1-alexander.levin@verizon.com> In-Reply-To: <20171207154513.4154-1-alexander.levin@verizon.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-messagesentrepresentingtype: 1 x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [10.144.60.250] Content-Type: text/plain; charset="iso-8859-1" MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by nfs id vB7HuJVN009713 From: Alexey Khoroshilov [ Upstream commit 362741a21a5c4b9ee31e75ce28d63c6d238a745c ] There is the only path, where mxs_lradc_probe() leaves clk undisabled, since it does return instead of goto err_clk. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov Signed-off-by: Lee Jones Signed-off-by: Sasha Levin --- drivers/mfd/mxs-lradc.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/mfd/mxs-lradc.c b/drivers/mfd/mxs-lradc.c index 630bd19b2c0a..98e732a7ae96 100644 --- a/drivers/mfd/mxs-lradc.c +++ b/drivers/mfd/mxs-lradc.c @@ -196,8 +196,10 @@ static int mxs_lradc_probe(struct platform_device *pdev) platform_set_drvdata(pdev, lradc); res = platform_get_resource(pdev, IORESOURCE_MEM, 0); - if (!res) - return -ENOMEM; + if (!res) { + ret = -ENOMEM; + goto err_clk; + } switch (lradc->soc) { case IMX23_LRADC: -- 2.11.0