From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 03E02C47247 for ; Fri, 8 May 2020 12:53:22 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id CF32F24967 for ; Fri, 8 May 2020 12:53:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1588942401; bh=nYvNC5mp3p9E42LUYjMDSuncRs7p9od0b/nf87IZNn8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=loCynQSSQzzYN3RfdnGIoX124KAmu9lGpv9vp82wej5SQz0cSXQVoHDc5MbrjJFUb eW+heSAVHP/XD73UAa1owdRWs4SJclZf6RxgitabBPm4oJW/iUGIlN2LJ7S2ahhbO7 J/gOltdRZe8XdBgPYOMe23kpizAks75BYvS94FbI= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730068AbgEHMxU (ORCPT ); Fri, 8 May 2020 08:53:20 -0400 Received: from mail.kernel.org ([198.145.29.99]:35018 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730064AbgEHMxT (ORCPT ); Fri, 8 May 2020 08:53:19 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id C74ED24953; Fri, 8 May 2020 12:53:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1588942399; bh=nYvNC5mp3p9E42LUYjMDSuncRs7p9od0b/nf87IZNn8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=1AXzAubStcLuiGgtSsMDkY8k7mTiaL0hVQg8ZrWiFTFUpvKHZN9LGuq5509O8Hstk QFzzf+YYaR9w7Rflgz0cEZWQZau1WqV/oRJ5HoS+L+rq7JGQpR8zy6O44YCAoXHmiK TkTPB6EBwuHpgy2ZZOPGAQbjpQATUI735+SAsw5o= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, =?UTF-8?q?Amadeusz=20S=C5=82awi=C5=84ski?= , Ranjani Sridharan , Pierre-Louis Bossart , Mark Brown , Sasha Levin Subject: [PATCH 5.4 07/50] ASoC: topology: Check return value of soc_tplg_dai_config Date: Fri, 8 May 2020 14:35:13 +0200 Message-Id: <20200508123044.352094803@linuxfoundation.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200508123043.085296641@linuxfoundation.org> References: <20200508123043.085296641@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Amadeusz Sławiński [ Upstream commit dd8e871d4e560eeb8d22af82dde91457ad835a63 ] Function soc_tplg_dai_config can fail, check for and handle possible failure. Signed-off-by: Amadeusz Sławiński Reviewed-by: Ranjani Sridharan Reviewed-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20200327204729.397-7-amadeuszx.slawinski@linux.intel.com Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- sound/soc/soc-topology.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/sound/soc/soc-topology.c b/sound/soc/soc-topology.c index 22960f5932c7f..2d4a5a3058c41 100644 --- a/sound/soc/soc-topology.c +++ b/sound/soc/soc-topology.c @@ -2431,7 +2431,7 @@ static int soc_tplg_dai_elems_load(struct soc_tplg *tplg, { struct snd_soc_tplg_dai *dai; int count; - int i; + int i, ret; count = le32_to_cpu(hdr->count); @@ -2446,7 +2446,12 @@ static int soc_tplg_dai_elems_load(struct soc_tplg *tplg, return -EINVAL; } - soc_tplg_dai_config(tplg, dai); + ret = soc_tplg_dai_config(tplg, dai); + if (ret < 0) { + dev_err(tplg->dev, "ASoC: failed to configure DAI\n"); + return ret; + } + tplg->pos += (sizeof(*dai) + le32_to_cpu(dai->priv.size)); } -- 2.20.1