From patchwork Fri May 8 12:35:25 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 226191 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=unavailable 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 D899DC47257 for ; Fri, 8 May 2020 12:57:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id ADD362054F for ; Fri, 8 May 2020 12:57:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1588942667; bh=cI6v8CZuocD6h+XIZMxcmeIiHC1Q3wA6Tn75/oE61No=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=ywWtBG5moOdAsG91s0ZTbLuEI86SknGZxJXEyTw8KPQoYYuXeI7XwGMubhTw/iiOO OvHc7V61t9T9saYjCv5TIpisc+6BuwVJue32TKEGW0D/TqZ8IyBoQ7nxpaGFsyQqUX Otxx9UKNgW3WN60md0RGYx8e1ZwSmR6r0DCxwT20= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730028AbgEHMzO (ORCPT ); Fri, 8 May 2020 08:55:14 -0400 Received: from mail.kernel.org ([198.145.29.99]:37998 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728224AbgEHMzN (ORCPT ); Fri, 8 May 2020 08:55:13 -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 528612054F; Fri, 8 May 2020 12:55:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1588942512; bh=cI6v8CZuocD6h+XIZMxcmeIiHC1Q3wA6Tn75/oE61No=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=mCrpR1TaEl0wENXtaIr0JQpEOaXBR1KXfWMZ2m4hDZsgmVKpIkyuTw55Bq+e9rRcP kdQ5eZSVG+K7PBPIjPfonyYREnpdtnEYvZ44QllqrNJKy72mBMX6BGK1z9C6VBK8qy oYybDQY/+XujH3M7gTOTcz+/DEmEt16l61LdUKUA= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, =?utf-8?q?Amadeusz_S=C5=82awi=C5=84ski?= , Ranjani Sridharan , Pierre-Louis Bossart , Mark Brown , Sasha Levin Subject: [PATCH 5.6 08/49] ASoC: topology: Check return value of soc_tplg_dai_config Date: Fri, 8 May 2020 14:35:25 +0200 Message-Id: <20200508123044.132239672@linuxfoundation.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200508123042.775047422@linuxfoundation.org> References: <20200508123042.775047422@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 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 ca0ac5372b293..e6a17ab433eea 100644 --- a/sound/soc/soc-topology.c +++ b/sound/soc/soc-topology.c @@ -2524,7 +2524,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); @@ -2539,7 +2539,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)); }