From patchwork Wed Aug 24 12:33:13 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vinod Koul X-Patchwork-Id: 9298517 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id AF4E2607D0 for ; Thu, 25 Aug 2016 01:00:32 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9BA702912E for ; Thu, 25 Aug 2016 01:00:32 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 904BD29131; Thu, 25 Aug 2016 01:00:32 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 04BE62912E for ; Thu, 25 Aug 2016 01:00:32 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 37A8126726A; Thu, 25 Aug 2016 03:00:31 +0200 (CEST) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 1D2E72674AB; Wed, 24 Aug 2016 21:20:22 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id B64AF266DA1; Wed, 24 Aug 2016 21:20:18 +0200 (CEST) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by alsa0.perex.cz (Postfix) with ESMTP id 9B2D426759C for ; Wed, 24 Aug 2016 14:25:31 +0200 (CEST) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga101.fm.intel.com with ESMTP; 24 Aug 2016 05:25:30 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.28,570,1464678000"; d="scan'208";a="752906389" Received: from vkoul-udesk7.iind.intel.com ([10.223.84.143]) by FMSMGA003.fm.intel.com with ESMTP; 24 Aug 2016 05:25:28 -0700 From: Vinod Koul To: alsa-devel@alsa-project.org Date: Wed, 24 Aug 2016 18:03:13 +0530 Message-Id: <1472042001-9582-2-git-send-email-vinod.koul@intel.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1472042001-9582-1-git-send-email-vinod.koul@intel.com> References: <1472042001-9582-1-git-send-email-vinod.koul@intel.com> Cc: liam.r.girdwood@linux.intel.com, patches.audio@intel.com, broonie@kernel.org, Vinod Koul Subject: [alsa-devel] [PATCH 1/9] ASoC: Intel: Skylake: check manifest size X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP For some platforms manifest data may not be defined, thus the private data would not be defined as well. So check the size of private data and proceed only if it is valid. Signed-off-by: Vinod Koul --- sound/soc/intel/skylake/skl-topology.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sound/soc/intel/skylake/skl-topology.c b/sound/soc/intel/skylake/skl-topology.c index 108ebb9ab329..6bceab8f0bac 100644 --- a/sound/soc/intel/skylake/skl-topology.c +++ b/sound/soc/intel/skylake/skl-topology.c @@ -2401,6 +2401,10 @@ static int skl_manifest_load(struct snd_soc_component *cmpnt, struct skl *skl = ebus_to_skl(ebus); int ret = 0; + /* proceed only if we have private data defined */ + if (manifest->priv.size == 0) + return 0; + minfo = &skl->skl_sst->manifest; skl_tplg_get_manifest_data(manifest, bus->dev, minfo);