From patchwork Sat Oct 22 07:23:19 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 7378 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4242:0:0:0:0:0 with SMTP id s2csp1096560wrr; Sat, 22 Oct 2022 01:05:26 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5YM8ttL3pU/lfL4yfMRfMhTwnIdnO7V+Ey8czwuJ//ivdHDtcz9T+zRSgPenQpUn/AfPxS X-Received: by 2002:a63:84c6:0:b0:46e:df48:afdd with SMTP id k189-20020a6384c6000000b0046edf48afddmr892028pgd.458.1666425926551; Sat, 22 Oct 2022 01:05:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666425926; cv=none; d=google.com; s=arc-20160816; b=s+WSn3W+FJjPeLYktdGhVxMfenr2QIsKQGuYISoaWbmLnCIyKipyhU6Q8rUiuW0w1Z U1qeCFQZMl/Y2xm5htJJ1kalwXmaWLTVaLOyb2del/XpVxzZTenx8HxIdn4SK77u2cic o8p3pJ+wqve8EP52ErYguYaqmtq6bOg1g2SmfGEDAsZp/sd1V78Ib7fONvbGb0RS5+Mw TzrOujirGMXwSmGSK72L9lnM2Eb0YkmsbverejiIgxtfdovC+CbHpRrnDPLaJqV13PfL 1y4d0rWzbhSlb788gdIJ+pKaQ5+ObfLs47mtw4P/5TU+zeAi6Jj4e/I5UXoWM2c4gCv5 C04A== 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=d0WDyIyQA8uDUrNU7usXAgtk1xz5lkGM09fFgR+BrTk=; b=tPpr1WgwgPz8MlvfkyLK5KVcU/6WvRF31FI0KewW5fH3+hk+D67Hi8axQf4Y8vMkg2 rlPAxsZ+BohKaVeCxG4YDkqVMwNGMUTLbJVk7GRceNEPuD/6aA8jxq84b0kvIwrFboP9 ovld6sOgUy2R37yFYaOg3ppaDex01rpmMsZyCt3Ses9to1sv7+DFxjDPs9UuXityhR0F i25fltMBPi05oSvSmwzyQHGMRNvaDcDEaoOvVnek0wq4/uJWuh4VNjsGhuilemCTWmmI 9UxSQCd8pWQm1Fntnqb5YUVYdMmjaPMLC79wBapQ1wFqr0IPYU7DmdCL0EYvsLMKWfv9 eNqw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=UJFPx6Xq; 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 l9-20020a170903244900b0017d2c45e93fsi31482962pls.169.2022.10.22.01.05.13; Sat, 22 Oct 2022 01:05:26 -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=UJFPx6Xq; 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 S232766AbiJVIEL (ORCPT + 99 others); Sat, 22 Oct 2022 04:04:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42398 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232332AbiJVH5d (ORCPT ); Sat, 22 Oct 2022 03:57:33 -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 82E8213A5B4; Sat, 22 Oct 2022 00:48:50 -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 BDF5AB82DEF; Sat, 22 Oct 2022 07:48:26 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2345EC433D7; Sat, 22 Oct 2022 07:48:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666424905; bh=0M6ldLkPIHOA6wq73aLHiYig4mC6FQqYwNyvlLZ3uo0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=UJFPx6Xqv0PnA0Ahf0iwef+DM2x1DeQlJDVaoK+yZ7wDSVOOyJDHy+CDCgebITE/q 4zVJQ4gWO2VMIvE6xt8WWPoAqHSAPMpWRVGGexBrnJ1jwysoHHwhUsQF8mW2uTqzDw 4ssOv9macPzzrF3OoYHXIIRz+Rlo46s8oR+UJm/Y= 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.19 320/717] ASoC: rsnd: Add check for rsnd_mod_power_on Date: Sat, 22 Oct 2022 09:23:19 +0200 Message-Id: <20221022072508.533986921@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221022072415.034382448@linuxfoundation.org> References: <20221022072415.034382448@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 X-Spam-Status: No, score=-7.3 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?1747374232202600539?= X-GMAIL-MSGID: =?utf-8?q?1747374232202600539?= 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 6156445bcb69..e39eb2ac7e95 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 5137e03a9d7c..16befcbc312c 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 3572c2c5686c..1de0e085804c 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 0ea84ae57c6a..f832165e46bc 100644 --- a/sound/soc/sh/rcar/src.c +++ b/sound/soc/sh/rcar/src.c @@ -463,11 +463,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 43c5e27dc5c8..7ade6c5ed96f 100644 --- a/sound/soc/sh/rcar/ssi.c +++ b/sound/soc/sh/rcar/ssi.c @@ -480,7 +480,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);