From patchwork Tue Jun 14 16:03:45 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vinod Koul X-Patchwork-Id: 9176239 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 B680E6075D for ; Tue, 14 Jun 2016 15:57:56 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A83FC26A7B for ; Tue, 14 Jun 2016 15:57:56 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9D0C52793D; Tue, 14 Jun 2016 15:57:56 +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 1189D28236 for ; Tue, 14 Jun 2016 15:57:55 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 7F2462668CA; Tue, 14 Jun 2016 17:57:54 +0200 (CEST) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 8C8362667A9; Tue, 14 Jun 2016 17:57: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 A914E2619FB; Tue, 14 Jun 2016 17:57:20 +0200 (CEST) Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by alsa0.perex.cz (Postfix) with ESMTP id 2F41E2616C9 for ; Tue, 14 Jun 2016 17:57:12 +0200 (CEST) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga104.fm.intel.com with ESMTP; 14 Jun 2016 08:57:11 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos; i="5.26,471,1459839600"; d="scan'208"; a="1001765348" Received: from vkoul-udesk7.iind.intel.com ([10.223.84.143]) by fmsmga002.fm.intel.com with ESMTP; 14 Jun 2016 08:57:09 -0700 From: Vinod Koul To: alsa-devel@alsa-project.org Date: Tue, 14 Jun 2016 21:33:45 +0530 Message-Id: <1465920225-11131-2-git-send-email-vinod.koul@intel.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1465920225-11131-1-git-send-email-vinod.koul@intel.com> References: <1465920225-11131-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 2/2] ASoC: Intel: Skylake: Check for module list being NULL 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 While clearing loaded module count, we should check first to see if module list is NULL or not. Some distributions can ship with no modules and thus list can be empty. Signed-off-by: Vinod Koul --- sound/soc/intel/skylake/skl-sst.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sound/soc/intel/skylake/skl-sst.c b/sound/soc/intel/skylake/skl-sst.c index dff1076a5f9e..eaf0c9d19782 100644 --- a/sound/soc/intel/skylake/skl-sst.c +++ b/sound/soc/intel/skylake/skl-sst.c @@ -384,6 +384,9 @@ void skl_clear_module_cnt(struct sst_dsp *ctx) { struct skl_module_table *module; + if (list_empty(&ctx->module_list)) + return; + list_for_each_entry(module, &ctx->module_list, list) { module->usage_cnt = 0; }