Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp707870pxb; Tue, 5 Apr 2022 19:41:24 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz7cOTYta3Z9jyVtbJ/GjSncIQxgL3ri+6y+TWWCCsYzWvfbEguXfpMgEoRgSgm98qJpztB X-Received: by 2002:a17:907:7286:b0:6df:f778:2585 with SMTP id dt6-20020a170907728600b006dff7782585mr5996020ejc.244.1649212884138; Tue, 05 Apr 2022 19:41:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649212884; cv=none; d=google.com; s=arc-20160816; b=THqV5lKg1rd1iTWWZNiIFJ2r5cYfgLqVJbEuFgSTQENe/8nLwYUK573sqfauHXcNH2 Hha5tEIV7J/nhqdDU+JdIhqqXB+MRCzK7NBBAY3pffRiTnu+S+bYmgsozjzwsyqFOyLH MmjHk+aeiniY6acnc6zOyY9ZbvouiA3t0ce3glWe5HVZk3GPzTj4nViifQRnwj67tw9g o5qyHsqpaCDMEIhR+D4zl6TTzw40gCSYDX0ljYeHfughOH73J8LpgHW4dBqGCE7e+udX wmQ/VVp9tppFJxM2SjXLIJEVflnnNJp8x27GhY/2BA27YdGz4zVDcwgVB70s+o8UhPYH QTOQ== 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=J3fZORjn0i1zBDMZJq0qht/uw97jUBKr0atqLPS5nHc=; b=oJOqReWRMbCRHMNGNUqBLWHkUfuHne7AqzGEaTbQwDvzRIlpinsgvuVkUkLk6A4SGs STZS8uaidPKaPVFryavFvGwwrksLyb3/7QcK4DyuEfiEAMVPTkpQmAJCEbElTlxgglfm Lpb5o5DwJIPxo1TmdQAZoD53FlFgOTimFAzJuuG/PmGl5EOCmPDI23jOAjQoqSO/VljW LFxoMHyL5TbvrztU+drxtcECQejyjN2zxpuIHUMXQWffeZp2QV5Os+5I1vIcdNYEsvV1 M0ozpuaEyU404inTIq4kjlqFxSYZCk0u/n/bBfXQpmmlpVzwVxDm0gkV3p7EzeMHE7VA +9Zw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=SCHNsgEz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id o7-20020a1709061b0700b006e7fe2ddfcdsi4741908ejg.428.2022.04.05.19.40.56; Tue, 05 Apr 2022 19:41:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=SCHNsgEz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1383029AbiDEMRu (ORCPT + 99 others); Tue, 5 Apr 2022 08:17:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52254 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244972AbiDEIww (ORCPT ); Tue, 5 Apr 2022 04:52:52 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2EEC31CB36; Tue, 5 Apr 2022 01:48:14 -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 dfw.source.kernel.org (Postfix) with ESMTPS id BFBE8614F9; Tue, 5 Apr 2022 08:48:13 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C5829C385A1; Tue, 5 Apr 2022 08:48:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1649148493; bh=ybT7+5zSo63r+ZXukOXUPT5DtGFQtgkMrq0vaM9uPB4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=SCHNsgEzW0rdJINgNA75TiOr1LxjRvhUlpLPdXGm6s8QIq83lpnwFcVNpK9gFO6zp ES7JTETSx6NrzN8niwYgynyfpy2aGKDYSkcaaJsZXuEwDBLis4qVUFz20ooWWt5ZR5 o31pAA6yACVc2xP5UcBI0TCr5zVPJqnkAtPF55co= 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 5.16 0374/1017] ASoC: fsi: Add check for clk_enable Date: Tue, 5 Apr 2022 09:21:27 +0200 Message-Id: <20220405070405.388075877@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220405070354.155796697@linuxfoundation.org> References: <20220405070354.155796697@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=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham 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 cdf3b7f69ba7..e9a1eb6bdf66 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