From nobody Fri Dec 19 20:32:51 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 522E6C38A2D for ; Mon, 24 Oct 2022 21:43:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230092AbiJXVni (ORCPT ); Mon, 24 Oct 2022 17:43:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36660 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231172AbiJXVnL (ORCPT ); Mon, 24 Oct 2022 17:43:11 -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 CC9E02E8BA3; Mon, 24 Oct 2022 12:53:26 -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 87CE3B81260; Mon, 24 Oct 2022 12:10:12 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E410EC433D7; Mon, 24 Oct 2022 12:10:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666613411; bh=MiaE12X1LvN9oohMud7WJDraPD8xqNI2YGqZjWZZdc0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XMX4uR8KK9waiuB2YN9DgEJLNKK5pIbjVCFjXTGISUkO2OfQpwOM/7zD3uynjMTP7 YgcVLbwjDRpPv7OpQJSnUr634lirPM0kT4AK76nGsRUOKcFL4pYkGHtbnmyYfggO3R b8z4Ip5f9/9fhj36c0ISOr3X+AyZ6aTltq/sy9QU= 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.4 096/255] ASoC: rsnd: Add check for rsnd_mod_power_on Date: Mon, 24 Oct 2022 13:30:06 +0200 Message-Id: <20221024113005.677599125@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221024113002.471093005@linuxfoundation.org> References: <20221024113002.471093005@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" 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 =3D rsnd_mod_power_on(mod); + if (ret < 0) + return ret; =20 rsnd_ctu_activation(mod); =20 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 =3D rsnd_mod_power_on(mod); + if (ret < 0) + return ret; =20 rsnd_dvc_activation(mod); =20 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 =3D rsnd_mod_power_on(mod); + if (ret < 0) + return ret; =20 rsnd_mix_activation(mod); =20 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 =3D rsnd_mod_to_src(mod); + int ret; =20 /* reset sync convert_rate */ src->sync.val =3D 0; =20 - rsnd_mod_power_on(mod); + ret =3D rsnd_mod_power_on(mod); + if (ret < 0) + return ret; =20 rsnd_src_activation(mod); =20 diff --git a/sound/soc/sh/rcar/ssi.c b/sound/soc/sh/rcar/ssi.c index 09af402ca31f..f8960bad2bd1 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, =20 ssi->usrcnt++; =20 - rsnd_mod_power_on(mod); + ret =3D rsnd_mod_power_on(mod); + if (ret < 0) + return ret; =20 rsnd_ssi_config_init(mod, io); =20 --=20 2.35.1