Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp3032003pxb; Mon, 18 Oct 2021 06:59:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz50qtD4LkTcMQgI+RkvUca4+VBd7LSQa7rjz3pCaLBQJROJCu6/eQ4/TiApJShsUy+KlCw X-Received: by 2002:a63:1717:: with SMTP id x23mr24033244pgl.182.1634565573254; Mon, 18 Oct 2021 06:59:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634565573; cv=none; d=google.com; s=arc-20160816; b=Vxh4ye5EXacTL2T3g71CZry63svatalEJh8iIcz7gYmnBaCz+aTIo2rJlIHEILBeGe bwc+nhTGCCPwHDjSgQFeKeF4cs80+keMk4PFMv488NWIRFe8rjj8yWi2IZ+5JLtxXcXG BWzAhFVikXdaumUWtIfRsxSREiSKxNSJdFZ9XEjjXED0kv53dJCisgOfEIxeoBQJyHF4 hekac3KjYeWeT850XrKa5kq3QKcjfz3RFhr+CDJ6kGLJA3lUg3rec47BwUbRtuzkbMwI l2XS9xmZXYKSCoj57K20sRxEylmIgIyA1oyYEbik3Bjn0QkghHQSnhTaODmPHygvK+1V CCfw== 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=1uGiTmn7wkoPmRchukr2+HU7o2iTyUipyySIeFHir8I=; b=ZS7kGHC46TBVYbJR7PKXDmC6giBx04iBxQ1UhDRIqr7CjQ5JsYkln++DyO6GOdOZYS jxr8tN0clQnIarSaqpK4UZ/z3cALX3zA4wYTGI2Vi73d+WIwr0mlU/PHOx3MDA16AWot oJya214ZskRl3Ndogcxiz2NLNjUOMDZ+tZ7hDPqrWM7RUyWFhyV4rSyBEwy6EBLN0T1K D1ZdDesswuExrDDtdG6SwNWJak9+YasRLmbqvzGk+Ac9exFV9NqCdABx2Qp+eafJeKbq CK4HsJ4TzVNi790DsqC3o+2DGyg7pfe22mVm3OXLV5QhTwIwbZGIO94ogTS+X3n5lJo0 Otbg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=PGOfY7BO; 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 o1si1961662pgs.604.2021.10.18.06.59.20; Mon, 18 Oct 2021 06:59:33 -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=PGOfY7BO; 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 S234447AbhJROAS (ORCPT + 99 others); Mon, 18 Oct 2021 10:00:18 -0400 Received: from mail.kernel.org ([198.145.29.99]:59060 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234569AbhJRN6Q (ORCPT ); Mon, 18 Oct 2021 09:58:16 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 24A0461A3A; Mon, 18 Oct 2021 13:41:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1634564481; bh=UPo2vUMpgPMX4CcfMB7wLs5NFHOo5Db/er6Z7OtjNDI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=PGOfY7BOAcA+SP/X2Zofx6y43Y3jTRMJYsSuHioQNCe92OU+eAm98TBm+fGxxreLk yfU7BvScV7P0JuX1u1vTSWwHd3B8FMZ7DbZ1ZK/lXNefZuPpmnvya9B15Hgzs2kRG1 gY2mZ2kEzZXajk4O5xqQq9DzBx4+iuIevINr7VXI= 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 5.14 072/151] iio: adc128s052: Fix the error handling path of adc128_probe() Date: Mon, 18 Oct 2021 15:24:11 +0200 Message-Id: <20211018132343.024116132@linuxfoundation.org> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20211018132340.682786018@linuxfoundation.org> References: <20211018132340.682786018@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 @@ -171,7 +171,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; }