Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp692618ybh; Tue, 10 Mar 2020 06:34:38 -0700 (PDT) X-Google-Smtp-Source: ADFU+vsCgIJ349ZrPXbdGXIQaSxzPo5njr4yV5GAuNsYWhzQJ5fZMzQkLcGp+wINxb2iiUBMkRKz X-Received: by 2002:aca:1917:: with SMTP id l23mr1199524oii.158.1583847278577; Tue, 10 Mar 2020 06:34:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1583847278; cv=none; d=google.com; s=arc-20160816; b=XpjvH4n7EjRXNrCEYk1iJmX3rv1948XEZIMx8xdcQvuCPep3oMvX5RleP0kf1cMz8s QgUDE5WoFsWZG4MiUS+8fRVa3Zi64De1LRte1kcLUFPmNpAdxzjS+wwhSvd8GlSpq+cc OXfbaSDfxXl05hBbdue8g9fSQZksr8oe808SXtt5G8n2p/tDhwiwP0c/XankwBQ0pLZN RZuUSnenmCcqQU1j1o9BOL9n6pZr5HLPhdsoBnoz5rIX+I7d7nHfqQtry4z016qA/AZc LVgmZm2GmCjbe3bjHpIRSChnIr1P3dbjKWe14V5s6QT7jmMCgzEggagrQQECAa0uMFmy S5rg== 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=SBFT1bTiBm35nSny85W5cc3Cvo0SSeNt+TFCvzk/gRk=; b=hg+Nedfw99+kVi1NxjoYvYhr9z4jUQCR1Agtb6YhTIobn0oT0exFwKDuxIyVXLF78l zxduRhmqEb+elvk0TY3JHM9ZqZWVkv4fTvrts2/hvM9k/B6Qm0q5q7YQMetgx0Y3PsOw xPSoHuZ/v3L2kucbYW0wsvOtCBuIrDeRPTDDFbA49tkKq4FhvDDSw71yrxcxrcqlfLje 7MktrsrBdslcNHKczhExRgGEi/++fDpakkrVZ+FHm7p/rYUrZQHTwx04doD5eSufHCaj tsD50TTbu3wrLM2gzZiZ6FABtr6Dm5kXB0UzB9jcSBHiehBfSc/4KCqLE+/5vhxInt85 kGEQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ZTewHxJr; 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 k23si7802644otb.210.2020.03.10.06.34.24; Tue, 10 Mar 2020 06:34:38 -0700 (PDT) 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=ZTewHxJr; 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 S1728280AbgCJNdl (ORCPT + 99 others); Tue, 10 Mar 2020 09:33:41 -0400 Received: from mail.kernel.org ([198.145.29.99]:51786 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726892AbgCJMrw (ORCPT ); Tue, 10 Mar 2020 08:47:52 -0400 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 E94B32468D; Tue, 10 Mar 2020 12:47:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1583844471; bh=rajRhCp+31tFUezmvsnzAAkPUVlzKGxQwzKgz5dhv9Y=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZTewHxJrjIMxb0dti5x2ojRfWeFNpIUFNGobAi1041zz8O+qifd/i0DsgCRCBsODV w1ukCPxh/k6mqennDklCpWmXKYRet0j/mA/O4DiZPCzdGewdNWRfmkEESD8w2smqIF MATOBfQupA/5B1sWc0QUTdZLDTm66Wfh4lPp/QRY= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Matthias Reichl , Pierre-Louis Bossart , Mark Brown Subject: [PATCH 4.9 79/88] ASoC: pcm512x: Fix unbalanced regulator enable call in probe error path Date: Tue, 10 Mar 2020 13:39:27 +0100 Message-Id: <20200310123624.370298423@linuxfoundation.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200310123606.543939933@linuxfoundation.org> References: <20200310123606.543939933@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: Matthias Reichl commit ac0a68997935c4acb92eaae5ad8982e0bb432d56 upstream. When we get a clock error during probe we have to call regulator_bulk_disable before bailing out, otherwise we trigger a warning in regulator_put. Fix this by using "goto err" like in the error cases above. Fixes: 5a3af1293194d ("ASoC: pcm512x: Add PCM512x driver") Signed-off-by: Matthias Reichl Reviewed-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20200220202956.29233-1-hias@horus.com Signed-off-by: Mark Brown Signed-off-by: Greg Kroah-Hartman --- sound/soc/codecs/pcm512x.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) --- a/sound/soc/codecs/pcm512x.c +++ b/sound/soc/codecs/pcm512x.c @@ -1441,13 +1441,15 @@ int pcm512x_probe(struct device *dev, st } pcm512x->sclk = devm_clk_get(dev, NULL); - if (PTR_ERR(pcm512x->sclk) == -EPROBE_DEFER) - return -EPROBE_DEFER; + if (PTR_ERR(pcm512x->sclk) == -EPROBE_DEFER) { + ret = -EPROBE_DEFER; + goto err; + } if (!IS_ERR(pcm512x->sclk)) { ret = clk_prepare_enable(pcm512x->sclk); if (ret != 0) { dev_err(dev, "Failed to enable SCLK: %d\n", ret); - return ret; + goto err; } }