Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp738864ybc; Sat, 16 Nov 2019 07:51:42 -0800 (PST) X-Google-Smtp-Source: APXvYqz2/VE4tx7m7VSVy9DAbVCzFIQMSBaVyKqesSWUNpJnfrBWitAZ4pqjzHSNcsHnR30vsfEi X-Received: by 2002:a17:906:1d19:: with SMTP id n25mr10407091ejh.151.1573919502532; Sat, 16 Nov 2019 07:51:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573919502; cv=none; d=google.com; s=arc-20160816; b=FFVrOT5SpaGsaS6IOgBYHUMLTVLbOFcEhFI+gK39BAjaJj2bHMKP6ggOcTfOZ8nwet 3IbwaBqfQsxFdfdDqC89pVsHq1gGXCgPNz3elO9cwS6l8U0cmZr6EIB3vIUCKxTdo8yH uR2eaupc7g57dQjpbwAEdBr6MwUKP4YeygAsVAVEObV2deK2dohsrzTTPoRsOT/bxWn5 Dw7RwN/5pGhgTrH2DhAxh6E49k5aN8L6EiTxjqtVYwszy/iI6fH7kOZyWiAH/Wz8+JDh xonxaaNuIBj4Knh0zTVLXg1C4E/rJylNGp+8z/q51POvXO7P4AGcITjptbvZQPOvCy8s qsrA== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=1KPSfAUL6Cd8O9D9kmxVwZh6l0lMi5mi2WO9brCv+f0=; b=k1zZR2tjqO59vnfyAbyn6uWwDeoWdEC0+LYkzA+NaXudZiaoUNfxjsSHt062Wd875U kjxXUwaeKBmk7h9tNrQdIIJE8Km4dMocXjvPmscJHbWsJb7x+DtY4ZaxPlh5N7mqTHm0 urr4KlpKX+689kLDGIz1iR3rpDDAYw0KMh/bvdobShSTh8GZ8bEwe9nr7mk8sGTNE5wv 5knRTvn2lYnq0slvux+lw+amGsYlyLMkxyO4DG05az9krGAdGDe87IJ1YBsv4Vp4S7Z2 yD2UI77/dY30ntgiyDy9o78kcUZ4MgeV/uzp/KdDMNRr4W0okQEMs2CQT4pNgy67KM1r OjPw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Ut1MxyLU; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t4si10119918edc.171.2019.11.16.07.51.18; Sat, 16 Nov 2019 07:51:42 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Ut1MxyLU; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729617AbfKPPrE (ORCPT + 99 others); Sat, 16 Nov 2019 10:47:04 -0500 Received: from mail.kernel.org ([198.145.29.99]:52888 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729419AbfKPPqb (ORCPT ); Sat, 16 Nov 2019 10:46:31 -0500 Received: from sasha-vm.mshome.net (unknown [50.234.116.4]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id B52C820833; Sat, 16 Nov 2019 15:46:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1573919191; bh=YRIoyCqFbllyk9Rbao0HAflYjxyFvS7VSLfoVAW4XKI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Ut1MxyLUNChfpP4BvrP2Xvxu5N7SydHrf6lLioKOmoSsG0n6lIdhUDsTulS7RSZkZ TGUeJmKR6EDHpWpypHG8bSgAuu3vp+6bYTBhlOYW144KeFUI7Ktb3ipECW0Z3ajGtY Tsp9mB+x48+7Wu1EyUEC0tIZU8vSl5ek/QrflQ5M= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Brian Norris , Douglas Anderson , Kalle Valo , Sasha Levin , ath10k@lists.infradead.org, linux-wireless@vger.kernel.org, netdev@vger.kernel.org Subject: [PATCH AUTOSEL 4.19 200/237] ath10k: snoc: fix unbalanced clock error handling Date: Sat, 16 Nov 2019 10:40:35 -0500 Message-Id: <20191116154113.7417-200-sashal@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191116154113.7417-1-sashal@kernel.org> References: <20191116154113.7417-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Brian Norris [ Upstream commit 82e60d920e8ad70cd9a280ab156566755f1fe4aa ] Similar to regulator error handling, we should only start tearing down the 'i - 1' clock when clock 'i' fails to enable. Otherwise, we might end up with an unbalanced clock, where we never successfully enabled the clock, but we try to disable it anyway. Fixes: a6a793f98786 ("ath10k: vote for hardware resources for WCN3990") Signed-off-by: Brian Norris Reviewed-by: Douglas Anderson Signed-off-by: Kalle Valo Signed-off-by: Sasha Levin --- drivers/net/wireless/ath/ath10k/snoc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/wireless/ath/ath10k/snoc.c b/drivers/net/wireless/ath/ath10k/snoc.c index fa1843a7e0fda..e2d78f77edb70 100644 --- a/drivers/net/wireless/ath/ath10k/snoc.c +++ b/drivers/net/wireless/ath/ath10k/snoc.c @@ -1190,7 +1190,7 @@ static int ath10k_wcn3990_clk_init(struct ath10k *ar) return 0; err_clock_config: - for (; i >= 0; i--) { + for (i = i - 1; i >= 0; i--) { clk_info = &ar_snoc->clk[i]; if (!clk_info->handle) -- 2.20.1