Received: by 2002:a19:f614:0:0:0:0:0 with SMTP id x20csp59431lfe; Fri, 15 Apr 2022 19:27:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxLpsdNVZlKLLUQtKMHrtqavNOFuiDRG/wqL3c+7bhTjDq73ZyYwYoCZ1pBvA6yDkWvQEW9 X-Received: by 2002:a17:90b:2247:b0:1d2:206f:13fa with SMTP id hk7-20020a17090b224700b001d2206f13famr879254pjb.234.1650076025414; Fri, 15 Apr 2022 19:27:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650076025; cv=none; d=google.com; s=arc-20160816; b=PrNDtNudeLBBbN2Ob4mCM3zZiIL1gBiEDtPgS0l9KWnFpY3EuODcCjmYcLl2/vcVAC EDOq67xRFh5cD2ZGGmDrr+VdwUacin4+SXm1a3CBZYTUW/no2i2kD6JuL8R3MBGSnCH7 gFQmhtkyJEGkWyzlhB82n8H3JN2KS4mBixujnPXJiIEhna7tS6w2UQO0YL6woUFg6bgx 6KMRcEoT7vE8Hwc7GyqczRGEGl4PNrTXv+zOdteI3vGj2xihrjYeDXDV3AEo12CkPlfW wVnzzeoqax25GaanFoELdTTjPh20COu/rA+lrU0wGlzSh5fQrN+761b3EtpgdNhsv2D6 4Y/A== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=SR4ptFUrZVAIw0qyKwin33Rql0a/VRCMKswGidMSrIw=; b=rQAwa/saV7G6eJccsZBFJgBI5C2FHZHD1Djaq8AbCD/4xjyPA+D77ia4cKtFf/MTnu p3NzwJ5dnaavDMGDMb+Fu5CfLeZlqZAxtpD+fb1W7zrsezx6WphjfcwXrY6g3z9IqRSU ELfhtZx0YngH/iqgNLSVNGAY0yjEFXCY/EK3nYtLLDRq4tg64iptdHdzdg6ltKoChZvS 9GVQHxqKTnbVjxpBKN3ZDePWC7CkaLPm9kBrCyLrIS4/330nlpXaNZY5UMLS4s0gSkX6 0xLA+lexLCaN1LLP1s2DVKJks4Jt9nGPZqbxh07MU0ZOOVo9Up/im9AdmaFIuQkhauVw wJsw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=CRTEe2pD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id 3-20020a631143000000b0039b0bd1c475si2711506pgr.816.2022.04.15.19.27.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Apr 2022 19:27:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=CRTEe2pD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 96AE3F4628; Fri, 15 Apr 2022 18:39:14 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236255AbiDNNdO (ORCPT + 99 others); Thu, 14 Apr 2022 09:33:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49874 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244345AbiDNNZR (ORCPT ); Thu, 14 Apr 2022 09:25:17 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2D98F9D0EF; Thu, 14 Apr 2022 06:19:42 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id A61C3B82910; Thu, 14 Apr 2022 13:19:41 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 03B40C385A1; Thu, 14 Apr 2022 13:19:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1649942380; bh=ZjnIkTT+EfwJEUtR8/sFEfd5fpB4d2azg7CksWVUHrQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=CRTEe2pDVVhbHwAl3JlM7mUBgfjCvW5MdiKZU9jxk+YcLjg4ddfm+BcgmqyT2MDfD ZuFlWzGyPYaz/Tfp3uiVHYCHOoRoaZCkCUvGXzlflSRFeFoN23Rk/8y1xp8e0qLJ/F JuAOg855EFTYE97vwmkt17vjQ5olYFyPIn/YG2kk= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jiasheng Jiang , Mark Brown , Sasha Levin Subject: [PATCH 4.19 108/338] ASoC: fsi: Add check for clk_enable Date: Thu, 14 Apr 2022 15:10:11 +0200 Message-Id: <20220414110841.984812575@linuxfoundation.org> X-Mailer: git-send-email 2.35.2 In-Reply-To: <20220414110838.883074566@linuxfoundation.org> References: <20220414110838.883074566@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Jiasheng Jiang [ Upstream commit 405afed8a728f23cfaa02f75bbc8bdd6b7322123 ] As the potential failure of the clk_enable(), it should be better to check it and return error if fails. Fixes: ab6f6d85210c ("ASoC: fsi: add master clock control functions") Signed-off-by: Jiasheng Jiang Link: https://lore.kernel.org/r/20220302062844.46869-1-jiasheng@iscas.ac.cn Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- sound/soc/sh/fsi.c | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/sound/soc/sh/fsi.c b/sound/soc/sh/fsi.c index aa7e902f0c02..f486e2b2c540 100644 --- a/sound/soc/sh/fsi.c +++ b/sound/soc/sh/fsi.c @@ -816,14 +816,27 @@ static int fsi_clk_enable(struct device *dev, return ret; } - clk_enable(clock->xck); - clk_enable(clock->ick); - clk_enable(clock->div); + ret = clk_enable(clock->xck); + if (ret) + goto err; + ret = clk_enable(clock->ick); + if (ret) + goto disable_xck; + ret = clk_enable(clock->div); + if (ret) + goto disable_ick; clock->count++; } return ret; + +disable_ick: + clk_disable(clock->ick); +disable_xck: + clk_disable(clock->xck); +err: + return ret; } static int fsi_clk_disable(struct device *dev, -- 2.34.1