Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp451479pxb; Tue, 3 Nov 2020 04:07:09 -0800 (PST) X-Google-Smtp-Source: ABdhPJzOuQQo/mH1q7PdqipVSjKkifPnnq4W9BEt+Os8be8V7NBSR1DHJXj9fGhYnYaUnVP4/ihJ X-Received: by 2002:a17:906:edaf:: with SMTP id sa15mr16890235ejb.454.1604405228802; Tue, 03 Nov 2020 04:07:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604405228; cv=none; d=google.com; s=arc-20160816; b=xS8N7/YaTPQNdRQ8mgt9SS4dr10sJJqi9yAXYhsSXs5jtCtYC5HPgoWmAku/22BkEs X50ZIbH+WU1SmtqHGbEBAkgGFgH+AcY1BrTf6uwEvKK9O+TFiLAZD2W3k9Q0YBDL05Rr HqfHW6cltGhMAwYLec6u+JCgP9kKtawRhNhUmvRxFuaWRkJlT0+kVl7OpwkU+nxFDHmw 84qN/Q1F/gbcvgEStCnr3D11AauVZ9N1rh5jC/d5uul6egaCeFunVOFJGSTwmbpQgXCS SPKeN8p5JKuwCj4hL2gBw67SS1yFJ8KYzsZ9lai3t2MbPQ32XccJ+YNMl6w8Oc40H4uP 7bIA== 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 :message-id:date:subject:cc:to:from; bh=L4Ed+QVwX4v9zHmwJbCC54FWB54wwzxOjG6g0klhPSQ=; b=BnB2uI+iIbq/Y0vOIQQvU1v1ieG1XC3ZPEzKFk3hjBwBSZj1fKeqBcPYBR65nStN1q OBd7GUmO1aVqnrIslCwR41edG6ZVfEOIRan2Mk7xi3lfZ8z3YwUW64a/hu/Ym95MEwOt uNujbPzD9XJYU35xboXQfsUUISrE5NX5Lyw6UIgcWODj4a8P0jGZybLAdsovkJrkzQtL OOWIwNc72XvXl/zwoQQNqDW8nhAgPOaQUbiTJ2aBF1RO02IhQthghkvLjjEMsnMDHW00 feiLI2wmZ8LAOXSU2Vg8+TSH0kXFbV8BDhNMKizEqkC76ex5Vq4TV+Zx/fKfoPUBK6pX Bm5Q== 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 dd24si11750300ejb.523.2020.11.03.04.06.45; Tue, 03 Nov 2020 04:07:08 -0800 (PST) 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 S1728915AbgKCMCT (ORCPT + 99 others); Tue, 3 Nov 2020 07:02:19 -0500 Received: from szxga04-in.huawei.com ([45.249.212.190]:7132 "EHLO szxga04-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727109AbgKCMCS (ORCPT ); Tue, 3 Nov 2020 07:02:18 -0500 Received: from DGGEMS402-HUB.china.huawei.com (unknown [172.30.72.59]) by szxga04-in.huawei.com (SkyGuard) with ESMTP id 4CQT111Zv4z15R0j; Tue, 3 Nov 2020 20:02:13 +0800 (CST) Received: from localhost.localdomain.localdomain (10.175.113.25) by DGGEMS402-HUB.china.huawei.com (10.3.19.202) with Microsoft SMTP Server id 14.3.487.0; Tue, 3 Nov 2020 20:02:08 +0800 From: Qinglang Miao To: Robin Murphy , Jonathan Cameron , Lars-Peter Clausen , Peter Meerwald-Stadler , Heiko Stuebner CC: , , , , Qinglang Miao Subject: [PATCH v2] iio: adc: rockchip_saradc: fix missing clk_disable_unprepare() on error in rockchip_saradc_resume Date: Tue, 3 Nov 2020 20:07:43 +0800 Message-ID: <20201103120743.110662-1-miaoqinglang@huawei.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.175.113.25] X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Fix the missing clk_disable_unprepare() of info->pclk before return from rockchip_saradc_resume in the error handling case when fails to prepare and enable info->clk. Fixes: 44d6f2ef94f9 ("iio: adc: add driver for Rockchip saradc") Suggested-by:Robin Murphy Signed-off-by: Qinglang Miao --- v2: remove useless braces because early return is pointless. drivers/iio/adc/rockchip_saradc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/iio/adc/rockchip_saradc.c b/drivers/iio/adc/rockchip_saradc.c index 1f3d7d639..12584f163 100644 --- a/drivers/iio/adc/rockchip_saradc.c +++ b/drivers/iio/adc/rockchip_saradc.c @@ -462,7 +462,7 @@ static int rockchip_saradc_resume(struct device *dev) ret = clk_prepare_enable(info->clk); if (ret) - return ret; + clk_disable_unprepare(info->pclk); return ret; } -- 2.23.0