Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp549204pxb; Thu, 23 Sep 2021 06:03:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxLWHZVcQbpEf3sQeVH+toC/iGubxvWu4GauEnCeCo+InMsA98s/9Fl3rkE4bEii3i/3zKE X-Received: by 2002:a19:ae15:: with SMTP id f21mr4071477lfc.402.1632402181024; Thu, 23 Sep 2021 06:03:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632402180; cv=none; d=google.com; s=arc-20160816; b=zJsSjkr9aL6ShZGf8D36vt2jz+o0l06mEp1QDBhIiT9Pfh48LItvQi+H1L+BTvkvoo gzt4y/t/AKU8kFdtpf9geuwyQw4T9NYCSuMhdJzN8AeJvU+bvlbJwLEe6gKsJDUUSAOP 9jatm35D3Xta5JHcpRQk87G7nauFrMme8dyppqtxkd+kTTWIUWpKRGZCwVGJbmAjBnDX cUVLm7PPPH4NYZ5DXOLjdU2WTDKl2CuwTFgU/SyaPwcDO9TcWhs2wfL1q7pRqtIBTSvb WgjChyt8qg8xWiT8+2ORFVbGTvSXL1UygZQwDj3RKBNSr8OXo4RQYBXX2MOTg3mYWHlY 1wvw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id; bh=pffhnW72YaYXDzvJV1FXsQ0ij+ZKGkOlnBUK4hsl78o=; b=RiKerVUDJGQEI81nJVMCcctDfTaIOJ1E3HpPgTqvv5nmAOZ67ZJf92xqEc+z4xz03w V6G5QKUAAUlz6RobnmzwyyITtm8jxbwTRwewnpo7ti0bOo6XkDh4rtMyrigtXch/whGI Dx3oe68g5hSyEUl6Ea+N3nfFdmJDUQQJ6jMlSTeyXaIJ4B+aa3t7/Hk5xE1QDKWSj7fu 4MGqZuPWQzNAajaAKjSeZOp0WWLzMAkfs8g9bCnD3lLoUAh5Bp68EAaTCTHVHBA01H+9 wQSc3e3/dXkIB+7sBCeBOJY77RYnNNYSz0XcXSWIuh/BiXbzJjnQBzYBn9pUVzI8vCHH EDHw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y20si5647228edt.1.2021.09.23.06.02.28; Thu, 23 Sep 2021 06:03:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241043AbhIWNCC (ORCPT + 99 others); Thu, 23 Sep 2021 09:02:02 -0400 Received: from mga04.intel.com ([192.55.52.120]:52141 "EHLO mga04.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235776AbhIWNCC (ORCPT ); Thu, 23 Sep 2021 09:02:02 -0400 X-IronPort-AV: E=McAfee;i="6200,9189,10115"; a="221946832" X-IronPort-AV: E=Sophos;i="5.85,316,1624345200"; d="scan'208";a="221946832" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Sep 2021 06:00:30 -0700 X-IronPort-AV: E=Sophos;i="5.85,316,1624345200"; d="scan'208";a="474841488" Received: from mmocanu-mobl1.ger.corp.intel.com (HELO [10.249.36.33]) ([10.249.36.33]) by orsmga007-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Sep 2021 06:00:27 -0700 Message-ID: Date: Thu, 23 Sep 2021 16:00:28 +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: Pierre-Louis Bossart , Daniel Baluta , broonie@kernel.org Cc: alsa-devel@alsa-project.org, kai.vehmanen@linux.intel.com, lgirdwood@gmail.com, linux-kernel@vger.kernel.org, ranjani.sridharan@linux.intel.com, Guennadi Liakhovetski , daniel.baluta@nxp.com 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 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. -- Péter