Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp3011903pxb; Mon, 18 Oct 2021 06:34:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyovYcDNM5Arrh6zFHlAVncK80OCHjqyxpXPRJMSXQ4XzJvHDFIZsr7E9nS2g9uUj6TB04f X-Received: by 2002:aa7:978b:0:b0:44c:abf1:a8b8 with SMTP id o11-20020aa7978b000000b0044cabf1a8b8mr29115100pfp.35.1634564091732; Mon, 18 Oct 2021 06:34:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634564091; cv=none; d=google.com; s=arc-20160816; b=ik4Y4ag7XEZbsr/jYFz2oBz3n5z36ekm1U1Chjl9/3QNEs2mnRnggCMubQlcQn60KD FERXlZ0HaNwb4Sk+kSEvzLjfpR+bDQk4cETNFSaopCu1wOa8fDy3+nJ+YkzAnMm0q+uk RSwGmLwTonGXY1E96BqtBlvwVx9HFpYMlf+c+qHQji/zH9dX7KFsec6878xQfe6taYU2 LGHUtBnom5GSX4r8j0ccWUQZotmuYoc7Rb67Tcg1x+0vRUjuAgA3YGwpPzkY2jEndYfz gwwv/Bq8A6lX3bqWie8xBTWJnzsq73CZQ+6abAhkfEV1es3IIXO8k4HHMDTEWfTkavpf +ddA== 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=r8b2W0iSVKIi5sYVlc5eiMEYIRyp1JfXIzwHQRpM7Rg=; b=sCj2VkU0tEMYs9f6xoYQFRYHWsUn47zn4830NYIYOFYtBC45Oe44wTP+AA3w1y6ywL Ebwg8z1pIxCsdzmN2DJo42iEBurMfTFyHRvO89P7oxdrRKXMFwTktwMA+gBP1tVSiL4a n1v6uTMGJdlkrgxmknhoIdTd4suDv/sd6TkCTVkr39g7m3LxvqnrTcP2sjTF3WlO912M qRmbQEhD49Q6llaZrNsXdnXfYyMtIH59sAXHiXIHNSHuQl1FtzG28eiufipRHiSL7+Eo XoMDvpoH0U/52gyVIzg6RZWGlhGmyGJPeju8P+6/wxaz9bwJQfE8A7aWcGCpquaTJn7d +kTw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=GBfqpaoN; 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 v12si3062119plp.293.2021.10.18.06.34.38; Mon, 18 Oct 2021 06:34:51 -0700 (PDT) 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=GBfqpaoN; 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 S233025AbhJRNeb (ORCPT + 99 others); Mon, 18 Oct 2021 09:34:31 -0400 Received: from mail.kernel.org ([198.145.29.99]:41884 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232645AbhJRNc2 (ORCPT ); Mon, 18 Oct 2021 09:32:28 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 5B8AC6137C; Mon, 18 Oct 2021 13:29:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1634563761; bh=FtHYWU8uoNMGOPVzqaJt1WELjfnqZATizaoH4Hwrzac=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=GBfqpaoNFA6Hp4majXyLsOyDO7AdR0CCHLkkm5xKx6Sr4dvW0/zbmYlJy+zbCC+dP 9eNiiHUVyaLoMmsgLi72YDTfwHO41HDwK+12aVJbm287JBTYPbpCde9NRKlKMzyJik etC7+A3nhBnkVC90HtAhSHaSKtEUs8PnVKaaXlpo= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Christophe JAILLET , Alexandru Ardelean , Stable@vger.kernel.org, Jonathan Cameron Subject: [PATCH 4.19 28/50] iio: adc128s052: Fix the error handling path of adc128_probe() Date: Mon, 18 Oct 2021 15:24:35 +0200 Message-Id: <20211018132327.472943996@linuxfoundation.org> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20211018132326.529486647@linuxfoundation.org> References: <20211018132326.529486647@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: Christophe JAILLET commit bbcf40816b547b3c37af49168950491d20d81ce1 upstream. A successful 'regulator_enable()' call should be balanced by a corresponding 'regulator_disable()' call in the error handling path of the probe, as already done in the remove function. Update the error handling path accordingly. Fixes: 913b86468674 ("iio: adc: Add TI ADC128S052") Signed-off-by: Christophe JAILLET Reviewed-by: Alexandru Ardelean Link: https://lore.kernel.org/r/85189f1cfcf6f5f7b42d8730966f2a074b07b5f5.1629542160.git.christophe.jaillet@wanadoo.fr Cc: Signed-off-by: Jonathan Cameron Signed-off-by: Greg Kroah-Hartman --- drivers/iio/adc/ti-adc128s052.c | 6 ++++++ 1 file changed, 6 insertions(+) --- a/drivers/iio/adc/ti-adc128s052.c +++ b/drivers/iio/adc/ti-adc128s052.c @@ -168,7 +168,13 @@ static int adc128_probe(struct spi_devic mutex_init(&adc->lock); ret = iio_device_register(indio_dev); + if (ret) + goto err_disable_regulator; + return 0; + +err_disable_regulator: + regulator_disable(adc->reg); return ret; }