Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp609469pxb; Mon, 25 Oct 2021 14:54:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzcghYjsiPFpJ+1Qe6OYjfczyOiZfbXvfmraSy7qmxzar1TG6O0M7eb1Sh4VNC/StDTYWPm X-Received: by 2002:a17:902:d509:b0:140:5705:6e15 with SMTP id b9-20020a170902d50900b0014057056e15mr7802464plg.51.1635198894025; Mon, 25 Oct 2021 14:54:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635198894; cv=none; d=google.com; s=arc-20160816; b=TvDeaMLPltlVm4y95XeMqakZQYXqSEH5MqfwKDV8IXyhjhE7ST/I6jFFZ3yfrMYamr S/XddZ17Io3bnUXie5MFPFjgs+j1VH5k4m4WJ0VkM/nrPHAWU0pSSSu6L5Ab+t3cqGkq HgPyeVEOssWi9gB2x34nUYUwOD1ypJ7+UMGi+Ypvj5cntcaSeh74+O/ulsx2D9Kgcf0o 4TvspNvMpuC62GcGDPTm3UkwgDwkdHk/Obk/t4au/+mRwI0b/dJkP6Pojz3fQ6PNv+kU 0gHjKa+dLCi6pNw5svfGMxjCob6uJaICPwYsG4F+lvEdnPZrA8WVUnGDg6Ok8EAimPrx 8Ysg== 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=5mSO08TlAHTZaLV9Wiqngf9qe2DJGes4BSgNn4DoQGk=; b=D5j34aHsJmx1B3f/4L5DA9y6vQqdf9MCqQ05p/xUlWpwn5dDMsS7CvugVLoIMXWiwf Bm9f2fdgUfx/IeEiT3ucbeKoWL8etA8HdSVuQBxT7QpBrHrs0g5/eoMayB4ChZVA5YRj 748i/5uLPqOMTUmn9JDEUMgfUoEh8lSx037GOHwn7KjdfJgsUZ+KcNF6khcn4gDRfejt OezxSnZPl7GAicLM+cpswP6YjyQo7RDp1+5gF4zlxzsEILZ9mNK9uVyk+zQTpyX4+NNV RMyCVuY0YhAoWsKfT89Cy+4saBPeD5wZuhQmmlZzFo0KPSUtujN4b9AmE4O7KAdeb1Ze rUmg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=NL0V4Q6s; 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 y23si22201991plp.281.2021.10.25.14.54.39; Mon, 25 Oct 2021 14:54:54 -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=NL0V4Q6s; 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 S233972AbhJYTTU (ORCPT + 99 others); Mon, 25 Oct 2021 15:19:20 -0400 Received: from mail.kernel.org ([198.145.29.99]:35288 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234256AbhJYTR7 (ORCPT ); Mon, 25 Oct 2021 15:17:59 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id B0F0B6105A; Mon, 25 Oct 2021 19:15:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1635189337; bh=U8RWI+ebkRlcn5U+fuezUV3XbWXlN+5igTpJ7kSL7EQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=NL0V4Q6szqN6iSHdiYPa+lSUGxGDMffR1XGOb0yy4BNNbidNZXArIH3+d+sd6D2A4 YGjCQcG36fLXP47euPFt8oWwGbYM1Yo+g6BoSBgkWuo/5egVvk/rXwseQRam3CdMec UAi/Zc8NkipOPYiOYC3RegE5a6MtAp/m+WukwEbI= 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.4 10/44] iio: adc128s052: Fix the error handling path of adc128_probe() Date: Mon, 25 Oct 2021 21:13:51 +0200 Message-Id: <20211025190930.724385130@linuxfoundation.org> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20211025190928.054676643@linuxfoundation.org> References: <20211025190928.054676643@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 @@ -159,7 +159,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; }