Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp978153pxb; Wed, 6 Apr 2022 05:53:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx71R5YgaGppR3+mWVoZIsAeOi4JACfj7qagQ9H2nHxdh250BZGgNV+wHjZhcylIFW2543J X-Received: by 2002:a17:90b:1d0e:b0:1c9:b74e:494 with SMTP id on14-20020a17090b1d0e00b001c9b74e0494mr9707772pjb.238.1649249610485; Wed, 06 Apr 2022 05:53:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649249610; cv=none; d=google.com; s=arc-20160816; b=dICyUGEaECZw5F0HdCeu3FfMGeuDladGDhI6VReXt955qKahMPyxKJNgW97xVTtPGu vdEItNzbZj1EFR1faGPi62KjDT0cjTMCQ5RJfq4/702nYg1bfJyXtircYRYhZdhAMHVY Q7b0m18RIWRsVuNEninwEA+Z1GPK0c2DyAWeDNRUtxkExFOmngwNrAMSnB+iyLMOrVIY Jzn4A/AK2ghSYpmDPODdXN0XFikzUL7E9Sq4cSUX9JpeCBozlAcI6njQzs2RL4mH/W76 tj0rw122li+t02KgGE7LwHW9+xtJOcFNIw4kSa8Teph7IPdD1Mle5oehLlLuoKS+LAU8 Rj6Q== 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=N8qdSN6omy5uMJyifWBqPoKEsbJnpoBGuyQUIPeqm5l0zG9WA1DrEe9GxIE9UfcUz4 9B2F/PqpiDry/PxqpUxN9zKH6IGcCqZOhW/uJ3UqeIavylIVBxkkx2Z5UB6lmFIZvoJF 6x/TPNkeIH8mGXQ2bVQ1RaN6Nm0kJz9nQxDUwxiyedlKcNIQzgw4W0PvN3uiyN0Oiatv BDkG/QE7WSy5kN6V7+zA1VGCX4C5fSZGDiYBO/Ek2+vmoWb7Ka+gQODlxJnq2+2q49Fx P8QenpYz3cceWKbO/LwRdwQ6/miIusAD1ot19rYPGqhRlIn3DE8jsRCA0wUpL0GjqzX3 ue6g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=D9JmSUeX; 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 w9-20020a170902e88900b00153b2d1657fsi16505764plg.391.2022.04.06.05.53.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Apr 2022 05:53:30 -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=D9JmSUeX; 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 02B7B4E96C7; Wed, 6 Apr 2022 02:58:10 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1574935AbiDEXB6 (ORCPT + 99 others); Tue, 5 Apr 2022 19:01:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39730 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1348638AbiDEJsK (ORCPT ); Tue, 5 Apr 2022 05:48:10 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E4B9633E82; Tue, 5 Apr 2022 02:34:20 -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 6378E616D9; Tue, 5 Apr 2022 09:34:20 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 714E6C385A6; Tue, 5 Apr 2022 09:34:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1649151259; bh=ybT7+5zSo63r+ZXukOXUPT5DtGFQtgkMrq0vaM9uPB4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=D9JmSUeXplX152/DUmqLjeM/oA7SDUMhAlejZlFi4R4eLhoQbOuXSx5UNes9La8KM biOccbbP/pne0S7cHA2KkyQqGSWbJkBXXGrI1w/uT+PBHp5bv5ds3M+W7afH+Ergst HF7kcQJHAQKWyuoy13fnaSVzXz38LpYyId3B3WkE= 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.15 351/913] ASoC: fsi: Add check for clk_enable Date: Tue, 5 Apr 2022 09:23:33 +0200 Message-Id: <20220405070350.367087936@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220405070339.801210740@linuxfoundation.org> References: <20220405070339.801210740@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 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