Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp5995014ybc; Wed, 27 Nov 2019 13:05:39 -0800 (PST) X-Google-Smtp-Source: APXvYqxrgaLmEAaO84yJTLh4y8FYtzcZE0/atSGxz9pb9be2QDrIX9R6p/PZI8g1kQxacRoxFxyF X-Received: by 2002:a17:906:2518:: with SMTP id i24mr51498658ejb.4.1574888738999; Wed, 27 Nov 2019 13:05:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574888738; cv=none; d=google.com; s=arc-20160816; b=HgXpQEn8eAipjeyBl3rlupCjFHb8FIWkwf5faZw7wEYXDQA99HSNAI/XFh0CzcWfHT 5yYoJ7hHXyHRbLbGn9ZgeLSsY56p/uGCwZ5bydGGYrN64YHAp880buU1JcdOlarPiYOG 6Z0Q7oRjFHTsfOdHBtZduYRm1Aaj41b/SZlpSFFxkw1ZhGRUtRH2YU7MLbcU3sChQP+j BxpOAqJSpp4pfntV4A/YOo3ILpWWAg+dU1p4IL8XSkdOE9akCe6dpO2BaS3CKMdKdmre mQ6BTgcB9oTVG6Dc9+FGlEnH/U89nAwcVluuvvqv38E9IsS1meyScyLVgKPzHPF8Gnf+ uNsA== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=1KPSfAUL6Cd8O9D9kmxVwZh6l0lMi5mi2WO9brCv+f0=; b=witzytC3labnEgRbSjOh4BOjin7TTwoeGKJ8rBp8NGef/Z11b9AX/5sI8C1/m/zTLs TajWzfnW6Th+Rtz0YP3cmjjCZUMlzedUFJ6W4BHzi3PBsDGkV3PF34eyWe02ndA3gBqa vuJ8SNbaV9+Aw1S2izRmOr3LxF0eVfJgHbInm/axf0Fw7HFUkm/Sq/mVshj73uvQDk83 uw4gyqIn9Sh8+1AByg+MpeT8ELuygdCr0eN0+lc9W7Wr4MroD5Pet+E9yHS46GdjUInC YD7PTcwPUCGe9WFO8dX+K5l3II+o8OoY9l+1kN54TNhIAZHZsFWeSBb1n6qmEr+Atccr 5YgA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=in82cZC+; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g7si1615747ejc.198.2019.11.27.13.05.15; Wed, 27 Nov 2019 13:05:38 -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=in82cZC+; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732132AbfK0VET (ORCPT + 99 others); Wed, 27 Nov 2019 16:04:19 -0500 Received: from mail.kernel.org ([198.145.29.99]:57678 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731521AbfK0VEP (ORCPT ); Wed, 27 Nov 2019 16:04:15 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 27D432086A; Wed, 27 Nov 2019 21:04:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1574888654; bh=YRIoyCqFbllyk9Rbao0HAflYjxyFvS7VSLfoVAW4XKI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=in82cZC+c+V6j4Nql8YgnMPj6PLNN3YN7khKUc2nL9QyAbZyKzuaThpSKfQA9PhEk ansdj/t3xCE9wiGDsECfUT+5IgbagamE06w/avgwomZN52HDmcrlOEw/nTeTKCdZnz KQA1nLTs8VZrW6d6RdpSqpPkg650Yc/B9SMdqBJs= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Brian Norris , Douglas Anderson , Kalle Valo , Sasha Levin Subject: [PATCH 4.19 217/306] ath10k: snoc: fix unbalanced clock error handling Date: Wed, 27 Nov 2019 21:31:07 +0100 Message-Id: <20191127203130.930122869@linuxfoundation.org> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191127203114.766709977@linuxfoundation.org> References: <20191127203114.766709977@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 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