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 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6891FC433F5 for ; Mon, 27 Sep 2021 09:10:28 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id B638C61002 for ; Mon, 27 Sep 2021 09:10:26 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org B638C61002 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.intel.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 8E0C515E2; Mon, 27 Sep 2021 11:09:33 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 8E0C515E2 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1632733823; bh=Yt/lvnbtpxKZSxFy8Ez9wJhmVr8GlhuRbCNhF1pg8rg=; h=Date:Subject:To:References:From:In-Reply-To:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=DXrp7sa32S4aAIMqDoWN6Vl/2Zhs97i4J8v1MUnWpXQ0DYaKawNPvwBgHtXIq2hak 0QcESlUjMVwbskYZeKjmzR1MFLfkQIanwH09XVP62Yb7c9qNEx9E0iZ+dDuumKKw2G uelma/QOH9puaBRNUPd3iWTS93dXHySZiA94s3SM= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 0D96FF801F7; Mon, 27 Sep 2021 11:09:33 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 0D774F80227; Mon, 27 Sep 2021 11:09:30 +0200 (CEST) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 5B98BF80161 for ; Mon, 27 Sep 2021 11:09:24 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 5B98BF80161 X-IronPort-AV: E=McAfee;i="6200,9189,10119"; a="288102269" X-IronPort-AV: E=Sophos;i="5.85,326,1624345200"; d="scan'208";a="288102269" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Sep 2021 02:09:20 -0700 X-IronPort-AV: E=Sophos;i="5.85,326,1624345200"; d="scan'208";a="518490283" Received: from unknown (HELO [10.251.220.221]) ([10.251.220.221]) by fmsmga008-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Sep 2021 02:09:17 -0700 Message-ID: <1ab40375-57fd-a3c6-68d7-9db78a20ed6e@linux.intel.com> Date: Mon, 27 Sep 2021 12:09:20 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.1.1 Subject: Re: [PATCH v2 10/12] ASoC: SOF: Intel: hda: make sure DAI widget is set up before IPC Content-Language: en-US To: Daniel Baluta References: <20210917143659.401102-1-daniel.baluta@oss.nxp.com> <20210917143659.401102-11-daniel.baluta@oss.nxp.com> <203bf6cd-6407-f01d-52c3-e399d06cb3f6@linux.intel.com> From: =?UTF-8?Q?P=c3=a9ter_Ujfalusi?= In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Guennadi Liakhovetski , Linux-ALSA , Kai Vehmanen , Liam Girdwood , Daniel Baluta , Linux Kernel Mailing List , Pierre-Louis Bossart , Mark Brown , Ranjani Sridharan , Daniel Baluta X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 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: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" Hi Daniel, On 24/09/2021 10:42, Daniel Baluta wrote: > On Thu, Sep 23, 2021 at 4:04 PM Péter Ujfalusi > wrote: >> >> >> >> On 23/09/2021 15:58, Pierre-Louis Bossart wrote: >>> >>>>> +static struct sof_ipc_dai_config *hda_dai_update_config(struct snd_soc_dapm_widget *w, >>>>> + int channel) >>>>> { >>>>> + struct snd_sof_widget *swidget = w->dobj.private; >>>>> struct sof_ipc_dai_config *config; >>>>> struct snd_sof_dai *sof_dai; >>>>> - struct sof_ipc_reply reply; >>>>> - int ret = 0; >>>>> >>>>> - list_for_each_entry(sof_dai, &hda_stream->sdev->dai_list, list) { >>>>> - if (!sof_dai->cpu_dai_name) >>>>> - continue; >>>>> + if (!swidget) { >>>>> + dev_err(swidget->scomp->dev, "error: No private data for widget %s\n", w->name); >>>> >>>> NULL pointer dereference, just return NULL without the print. The caller >>>> is printing anyways. >>> >>> yes good catch, we need a v3 with the fixes suggested by Peter in >>> https://github.com/thesofproject/linux/pull/3171/ applied. >> >> Only the second patch in the PR is applicable for upstream, but it >> should be squashed in for v3. > > Thanks Peter, will squash this in and send v3. As we discussed, I'll send the v3 with the fix. Thanks for sending the initial versions upstream! -- Péter