Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp3015225pxb; Mon, 18 Oct 2021 06:38:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxr55E3XAAF0VHQP7m4xJd3Is4PZvvMD4Tf8gD0czlL0eN1RXZ1isr0BPzfbfztes/VdYiq X-Received: by 2002:aa7:86d9:0:b0:44d:a354:b803 with SMTP id h25-20020aa786d9000000b0044da354b803mr17694878pfo.21.1634564330474; Mon, 18 Oct 2021 06:38:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634564330; cv=none; d=google.com; s=arc-20160816; b=UpcAChSzbOk6Mgcv2ZD23Zptyu9RTVe21r+HUXuG1AjflMhgF3lJrU+x5ENYY6j7lB Lxgo5koGgDh/Im7JXyoKlaDpZpX1HdJJ9IW4gNmAS/cCQtAYPBB2lHRvmWvGd45a1OYI Q2QVgncm+SmHl2H2gd4vHy0mcaIaujGrFGcPGU+7Dk3MTzrvARw1AYqxmuB01kmTJmxV G7XOhciLsTtlRiE0Kb0imYKaifuELfHz1ofNsHO54ZCmVMzh4I7a0N+K6Xv9y6BmUWOb Z98+IEnoemEq02+NyDItqfWwxOfzplFfQ0+KuEdzBdHa4NuOl1rKSpO9yYnhdkrbchSp xIIA== 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=g6bkktZw0+9Mr9tWfyJuTSqeQFwKrC7NyfCoW8U5hZ8=; b=YMAdIfRXaefmyJ+n4Hq0SFm4ef8gMgvYYYADy+mewgt4A5GWRtldX/fa9v3tSuCjlU ruWkqZ7lbPhxM+S5+5Q5FPnkOL1jJosFL1TjfvoifuyDn/mHuM3qPbwnlW9NagWd0r/u 4KXk0RV4KkUDNGigmfjzpzv8k+APsv+w2zN7IZyCSlHLBgxXAv9B8I4CnZVv0lhmfgKf yBSF0+fB1RYbm+8T4wCZa0VQb99PS70oUZo5TZTjeEYdh+jRYPwIIiSeA9Z2YjDtgR21 8uFDLrzxvLMe67/Xs01wvQVUHCJNN6NERe8kuFlqanzuZWs1rhAVvqelbnnsPssgxNge vznA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="j/jUHKRx"; 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 j70si3973793pgd.123.2021.10.18.06.38.37; Mon, 18 Oct 2021 06:38:50 -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="j/jUHKRx"; 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 S232591AbhJRNh5 (ORCPT + 99 others); Mon, 18 Oct 2021 09:37:57 -0400 Received: from mail.kernel.org ([198.145.29.99]:54296 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232224AbhJRNfp (ORCPT ); Mon, 18 Oct 2021 09:35:45 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id D4C3B613AD; Mon, 18 Oct 2021 13:30:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1634563852; bh=SySqrQ+lfqHHssJ5qAd4vWhK4QkCQgUagnZ1BBmiY84=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=j/jUHKRxiNBh7BSYp5gn8Tw6dK5dHnzGDmSjtoBIfzSdCgszaP6Z5VGPdd3XhcgfD FBQdsxyD1f03g2u6vwq68T1hwwWzF+eZJC1dnKMnnFgncfI+BFmcCNW+/zEQNuLPCc 5cxAnJp5N4boo962uov7x5stypTJ+APHB3ffSv14= 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.4 39/69] iio: adc128s052: Fix the error handling path of adc128_probe() Date: Mon, 18 Oct 2021 15:24:37 +0200 Message-Id: <20211018132330.770101397@linuxfoundation.org> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20211018132329.453964125@linuxfoundation.org> References: <20211018132329.453964125@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 @@ -172,7 +172,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; }