Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp3774938pxb; Mon, 27 Sep 2021 02:11:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzK3Xb+2kh2hjzfTuAg1FO7CMhQT4SO/lzkl5gXDyvFsObFxCcnrIYkw3HGYnIv4Ar5P8x0 X-Received: by 2002:a63:a03:: with SMTP id 3mr15751303pgk.326.1632733902645; Mon, 27 Sep 2021 02:11:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632733902; cv=none; d=google.com; s=arc-20160816; b=EmMQN9ENzqZlSXG1raknU/PMGPM47qE1eSiKWnem0NgmEoGh0uNzbHXSeGia7WIgd8 FdDTuD2gciuUdtPvMHeA1UqwxOEax/yk+sJlZsRQAKkBJJ1+SjTPeQEnsYxBiJWvDcTh 7m8l7B9NLsN7+Z/DwH4pV7Qcn3GcYt+unWGnpXZDwUMxvi+AHG5iZsOWiEzGG0QZt32P AmU0ZEV2cvEmqZEvkODh431FLC/Gcs12H2J141rqBSDzjoidd3uxK5vW6z+Zj2oJ7bDP RMRSUhZ/iedbhaI+V/VTUAvvHvmxkNfLjjXuCQ1ztX4DTcQFT0d7D1wqubJQfiISHg62 Vv7g== 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=DclzgXIsWqUCSFXBE6csTb6Ym25IsYzVs945EnydQXg=; b=rNBOb9NqB1daj2O6OwzGwYcGyYJa/dG7IdB8A2O+hv3F/h39Ualo/+MxP3ulzmSWt0 VnulGCdOMj5arjcKN1Cd9AgMp8DKPN3jLcxjS74/nSiQ0wevKupSkCfmeXjaZ4sKOA74 7JIK4ArAHonvZ3ho9DUr5aMn0NDFddrObSuOfWQI6m0TcRZl6PAZreGJKkpBykR7+8kV E6bn8XnfRrVnE6940imLF55rCY/X2Z2tAo7f4Z6iqBADKc6swWMBQ/t5DJYdBRvTqfSC sXL0VmG0fBG/b1NDDrKvU3fFLfwaYOBm17N3mULIGZSJ9Ivv46LO73mntHGRMQH/S/Z9 QP1w== 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 l4si2553626pjh.168.2021.09.27.02.11.29; Mon, 27 Sep 2021 02:11:42 -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 S233613AbhI0JK7 (ORCPT + 99 others); Mon, 27 Sep 2021 05:10:59 -0400 Received: from mga06.intel.com ([134.134.136.31]:24438 "EHLO mga06.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233519AbhI0JK6 (ORCPT ); Mon, 27 Sep 2021 05:10:58 -0400 X-IronPort-AV: E=McAfee;i="6200,9189,10119"; a="285450906" X-IronPort-AV: E=Sophos;i="5.85,326,1624345200"; d="scan'208";a="285450906" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga104.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 Cc: Guennadi Liakhovetski , Linux-ALSA , Kai Vehmanen , Linux Kernel Mailing List , Daniel Baluta , Pierre-Louis Bossart , Liam Girdwood , Mark Brown , Ranjani Sridharan , 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 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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