Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp1865106ybk; Sun, 17 May 2020 03:04:07 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxn1Yywa9W5aTWBVfHGJnhUKJ9I6aegDZPbQPCkXMBe9u/I5X75ELsGl9kxCx7oOsWfglTN X-Received: by 2002:a17:906:c308:: with SMTP id s8mr10801397ejz.366.1589709847608; Sun, 17 May 2020 03:04:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589709847; cv=none; d=google.com; s=arc-20160816; b=dY/gRNAvhNRBEJ+554AAMkonwKBqPZL1M1LLAGb4/7qyOJLmlla9bYAqIKsylzAwXL A7ADhOiIbGW4LL4vz/ridgcHzYR+yOFNweQCPEUhtQer4+biarX631fsFr9BJqgAEWb/ fT6swQMf8AsOZVPC/9cqDJKWTMyWo1LQ6VggYBmKL8RA5qCe7GQ4ZKNV0liVmuBs44g6 DqAw9Q1DZShIo5/hDSxp1xOs5GDZ2ND8boqwG2CTPBLUq/xtF4aiOBDLCWvtPySTYaqG wczrUTc8EiUcEWCzhGdJEiotsulvcxMfizblMLMQAHyCHHeYQ0HYRKmVuM83jkjFLEyT hpdA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=J8dOIC9Gzzm3JgLNUlCVYcjZBNi5cDDF+/IeVa8gsxM=; b=wnWpkcH2RJjQGOgk6xfL0QdnxirSLHHOW/LBYR7Lb0rVG8tjPoPs4DrZ1d+JiKvYE2 BmPYYw0BtmxTZ9tBU5KXxoLSBV6Caujt27FaYCcCaBJw78JNfVoKnHYeXOcNIfE61YtZ Tv4jP1hReu79GIAziQ2SCNeinr0V81+wtfJfaR5Xbz+TDT9W2BfLFyZLJv2Xf5aGOYVB vxe/iQf0ol2hpYllhaPyH3Q+TFBibETBUCPtEzp40XoXtjKnlLp/FxDTFNKXP0xlcBVu tsgdxIlk3DZgPyIQEJX5ufYyng8Wk90+AmI+RakeUvRMssUJNnA1bmxnI+yHgCMCq7GK MfEg== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l14si4790596eja.478.2020.05.17.03.03.41; Sun, 17 May 2020 03:04:07 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727832AbgEQKAA (ORCPT + 99 others); Sun, 17 May 2020 06:00:00 -0400 Received: from smtp02.smtpout.orange.fr ([80.12.242.124]:54488 "EHLO smtp.smtpout.orange.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727082AbgEQKAA (ORCPT ); Sun, 17 May 2020 06:00:00 -0400 Received: from localhost.localdomain ([92.140.207.208]) by mwinf5d56 with ME id flzv2200S4WJoZY03lzwDN; Sun, 17 May 2020 11:59:58 +0200 X-ME-Helo: localhost.localdomain X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Sun, 17 May 2020 11:59:58 +0200 X-ME-IP: 92.140.207.208 From: Christophe JAILLET To: Michael.Hennerich@analog.com, renatogeh@gmail.com, lars@metafoo.de, jic23@kernel.org, knaack.h@gmx.de, pmeerw@pmeerw.net, giuliano.belinassi@usp.br Cc: linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Christophe JAILLET Subject: [PATCH] iio: adc: ad7780: Fix a resource handling path in 'ad7780_probe()' Date: Sun, 17 May 2020 11:59:53 +0200 Message-Id: <20200517095953.278950-1-christophe.jaillet@wanadoo.fr> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org If 'ad7780_init_gpios()' fails, we must not release some resources that have not been allocated yet. Return directly instead. Fixes: 5bb30e7daf00 ("staging: iio: ad7780: move regulator to after GPIO init") Fixes: 9085daa4abcc ("staging: iio: ad7780: add gain & filter gpio support") Signed-off-by: Christophe JAILLET --- drivers/iio/adc/ad7780.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/iio/adc/ad7780.c b/drivers/iio/adc/ad7780.c index f47606ebbbbe..b33fe6c3907e 100644 --- a/drivers/iio/adc/ad7780.c +++ b/drivers/iio/adc/ad7780.c @@ -329,7 +329,7 @@ static int ad7780_probe(struct spi_device *spi) ret = ad7780_init_gpios(&spi->dev, st); if (ret) - goto error_cleanup_buffer_and_trigger; + return ret; st->reg = devm_regulator_get(&spi->dev, "avdd"); if (IS_ERR(st->reg)) -- 2.25.1