From patchwork Mon Oct 24 11:29:13 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 9203 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp458990wru; Mon, 24 Oct 2022 06:38:40 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4TiiDHQpJMgzn7S5NuaDjcZlEzaSw1VSKOx3A9++z0ADZ2eEYmA0RwP1AXZBSAQLHJxJQ6 X-Received: by 2002:a17:906:db0e:b0:77b:82cf:54a6 with SMTP id xj14-20020a170906db0e00b0077b82cf54a6mr27108419ejb.691.1666618709481; Mon, 24 Oct 2022 06:38:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666618709; cv=none; d=google.com; s=arc-20160816; b=k5GlDC3R8cWv+MIiGDihB9Llfn9XN5A1hd81LNmg7005kH6r+5VnJ72EfOA2o9mHKb Z7x+ZhStA2ohz7p1ere74zSdjavN2yOA7vYY+tJaYywg0diPpppALZNAiUxbkeDNPmoE HbxDMuCTqncAAlbjX6t5Jk3DvtUUUXgtRvCZCqvBQjQBYRrQHNNIwIMfcs/nv55q1+HI lY/XmLayH4shui8evaJZj6qSWteG1vUq48wZ/Q71GpOh7KQsMnCT4jlIHIGJNBUWYWRp 6O1v6oznDi5zFn9dGxg4/8fZivbXwhwZm4oJds61LxkVb296zyu+kW7sghMmiYazcEQ3 ua8A== 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=vpjlNrMc//uQNY2JUx0gdxNPRUS5WfU+Zy9ctR2MBrQ=; b=sFWmbVVV5G1m1K4zKQ7U2V2Ai2bY/XG6FRn8ynToUGP0EsLxGDLLLC983RcW3OZJ2S cHTITPXm5UYJGixEId2LcaXkvlF8vZPJziS12mwL/Emq3MwE9VoJcJU1IlrO3qw1+YUC /M4wOX2DdE9IDCOiPJd3nY4w00V1pauWXhyECPQtDR3yCTDr2cH/g4OkkoLmjC427tTU +Ovcb/ewlAmRFT8FyPd0MgfoaN6lQq+rw3OHLYDnvQw5gVUwKt6M45uzH8eogZ33EC7l EGcakgsLdvCFi8sw0qrWmFQIVKvl/d4tkI/4Zi2mn3THZKK99EBWzzYEDVUXHZ05FE5k Nq5A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="lN/s2xdU"; 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: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i13-20020a1709064fcd00b00780def41dc4si29846650ejw.527.2022.10.24.06.37.43; Mon, 24 Oct 2022 06:38:29 -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="lN/s2xdU"; 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 S236088AbiJXNep (ORCPT + 99 others); Mon, 24 Oct 2022 09:34:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39168 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236223AbiJXNaB (ORCPT ); Mon, 24 Oct 2022 09:30:01 -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 46B01AC499; Mon, 24 Oct 2022 05:33:15 -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 A7871612A8; Mon, 24 Oct 2022 12:22:41 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B7500C433D6; Mon, 24 Oct 2022 12:22:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666614161; bh=L56yfIyCXPpMNDYD538abftjPp7bHPmQP8DEim/UyWM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=lN/s2xdUTqYvZdHZCy85j6XUuEyRJzAECS5l93bd8eggy3rshlgsjKGYM/rPar3Mk 3j29i3BVtJjh03+us1HhE5x5X8tXZXd9drx5i7AM2CfgjThQcu8Bbjkx+rsL0Ebesj qMtQREeVgG6PaQQeoXk1uVR3hqtd4tcuqgptgt9s= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jiasheng Jiang , Kuninori Morimoto , Mark Brown , Sasha Levin Subject: [PATCH 5.10 156/390] ASoC: rsnd: Add check for rsnd_mod_power_on Date: Mon, 24 Oct 2022 13:29:13 +0200 Message-Id: <20221024113029.337552738@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221024113022.510008560@linuxfoundation.org> References: <20221024113022.510008560@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 X-Spam-Status: No, score=-7.6 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 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747576379727589725?= X-GMAIL-MSGID: =?utf-8?q?1747576379727589725?= From: Jiasheng Jiang [ Upstream commit 376be51caf8871419bbcbb755e1e615d30dc3153 ] As rsnd_mod_power_on() can return negative numbers, it should be better to check the return value and deal with the exception. Fixes: e7d850dd10f4 ("ASoC: rsnd: use mod base common method on SSI-parent") Signed-off-by: Jiasheng Jiang Acked-by: Kuninori Morimoto Link: https://lore.kernel.org/r/20220902013030.3691266-1-jiasheng@iscas.ac.cn Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- sound/soc/sh/rcar/ctu.c | 6 +++++- sound/soc/sh/rcar/dvc.c | 6 +++++- sound/soc/sh/rcar/mix.c | 6 +++++- sound/soc/sh/rcar/src.c | 5 ++++- sound/soc/sh/rcar/ssi.c | 4 +++- 5 files changed, 22 insertions(+), 5 deletions(-) diff --git a/sound/soc/sh/rcar/ctu.c b/sound/soc/sh/rcar/ctu.c index 7647b3d4c0ba..25a8cfc27433 100644 --- a/sound/soc/sh/rcar/ctu.c +++ b/sound/soc/sh/rcar/ctu.c @@ -171,7 +171,11 @@ static int rsnd_ctu_init(struct rsnd_mod *mod, struct rsnd_dai_stream *io, struct rsnd_priv *priv) { - rsnd_mod_power_on(mod); + int ret; + + ret = rsnd_mod_power_on(mod); + if (ret < 0) + return ret; rsnd_ctu_activation(mod); diff --git a/sound/soc/sh/rcar/dvc.c b/sound/soc/sh/rcar/dvc.c index 8d91c0eb0880..53b2ad01222b 100644 --- a/sound/soc/sh/rcar/dvc.c +++ b/sound/soc/sh/rcar/dvc.c @@ -186,7 +186,11 @@ static int rsnd_dvc_init(struct rsnd_mod *mod, struct rsnd_dai_stream *io, struct rsnd_priv *priv) { - rsnd_mod_power_on(mod); + int ret; + + ret = rsnd_mod_power_on(mod); + if (ret < 0) + return ret; rsnd_dvc_activation(mod); diff --git a/sound/soc/sh/rcar/mix.c b/sound/soc/sh/rcar/mix.c index a3e0370f5704..c6fe2595c373 100644 --- a/sound/soc/sh/rcar/mix.c +++ b/sound/soc/sh/rcar/mix.c @@ -146,7 +146,11 @@ static int rsnd_mix_init(struct rsnd_mod *mod, struct rsnd_dai_stream *io, struct rsnd_priv *priv) { - rsnd_mod_power_on(mod); + int ret; + + ret = rsnd_mod_power_on(mod); + if (ret < 0) + return ret; rsnd_mix_activation(mod); diff --git a/sound/soc/sh/rcar/src.c b/sound/soc/sh/rcar/src.c index 585ffba0244b..fd52e26a3808 100644 --- a/sound/soc/sh/rcar/src.c +++ b/sound/soc/sh/rcar/src.c @@ -454,11 +454,14 @@ static int rsnd_src_init(struct rsnd_mod *mod, struct rsnd_priv *priv) { struct rsnd_src *src = rsnd_mod_to_src(mod); + int ret; /* reset sync convert_rate */ src->sync.val = 0; - rsnd_mod_power_on(mod); + ret = rsnd_mod_power_on(mod); + if (ret < 0) + return ret; rsnd_src_activation(mod); diff --git a/sound/soc/sh/rcar/ssi.c b/sound/soc/sh/rcar/ssi.c index 042207c11651..2ead44779d46 100644 --- a/sound/soc/sh/rcar/ssi.c +++ b/sound/soc/sh/rcar/ssi.c @@ -518,7 +518,9 @@ static int rsnd_ssi_init(struct rsnd_mod *mod, ssi->usrcnt++; - rsnd_mod_power_on(mod); + ret = rsnd_mod_power_on(mod); + if (ret < 0) + return ret; rsnd_ssi_config_init(mod, io);