Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp547978pxb; Thu, 23 Sep 2021 06:01:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzwU+BwJ+kp6S7CCrZx/n7H00m/kqaJBd39sl4ArfZrstljErARohJOKrMWKxegSErXHSPJ X-Received: by 2002:a05:6512:33c3:: with SMTP id d3mr4067105lfg.194.1632402108780; Thu, 23 Sep 2021 06:01:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632402108; cv=none; d=google.com; s=arc-20160816; b=yrIXkBCJ15M93sG4N7wtHz6t91BTgMSvi870RXFllJW30sBq72S7mOPVEcdfgfQdZn gPSgR+zeUDWNrSvSVPRnCHrI8jn7DdiNjUN/jwsf2t8MsuedeGuKm6N6BJ8kBDDQ8yVi En5PmMa6gSZM9BS25hi4Us4lk4++U/SCYS1AcvcdR4CZr1Zpj+CBM9vVzWuLi3b1pfgy 0u99e7UVNAzTsrobwbsDf+HrGIqqAsSYL9Zhj7jcA1U1gb3qu6HDMXdSJ3q57dihR/dL hFPXIcCzzkxjVeq4O/4DOkdCbHNkQN7MG/4t0Bugb13duwNirHcbPlBe6rTtplA/kM+R GPkQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=J5tp6AEwY+6yN6EcI71C4X6dbvDW2ROSiGHf7lU7ePU=; b=Y+vkg9fX5mDv1wsF55+fNINfa2Wb94uBJb5IWEvdp6f8n54tNRUFqdy+q4Cf+IxzHE c3aqdTNB9quNvZFX8yghc1D/uSEvv5b05Fdv05wv5g0rHlz0/cnNG7dbPXr+qojMAnF/ 7GZVtMJ3FJLERkJ3Zz50kA58iW0fZCzzoMnBVruAmH1QqbJtvmtPZsVPy9Sdu448kqjG syimmGaj39ariGs1VkBjjBFEm6cj32OzKI67OPg+gLU6XhQ1gJc4SRHjc9Vc6oPrlb9P hicBswzJHx2K/eFpbnRKHC+eOeE1SP4GTKYdwt27LLTI8V+jJ/RpMViwKupbc3aRLwZ0 bLKQ== 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 o6si2606784edt.159.2021.09.23.06.01.12; Thu, 23 Sep 2021 06:01:48 -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 S241109AbhIWNAM (ORCPT + 99 others); Thu, 23 Sep 2021 09:00:12 -0400 Received: from mga05.intel.com ([192.55.52.43]:17297 "EHLO mga05.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241098AbhIWNAL (ORCPT ); Thu, 23 Sep 2021 09:00:11 -0400 X-IronPort-AV: E=McAfee;i="6200,9189,10115"; a="309392101" X-IronPort-AV: E=Sophos;i="5.85,316,1624345200"; d="scan'208";a="309392101" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Sep 2021 05:58:39 -0700 X-IronPort-AV: E=Sophos;i="5.85,316,1624345200"; d="scan'208";a="558348226" Received: from upatel2-mobl.amr.corp.intel.com (HELO [10.251.134.231]) ([10.251.134.231]) by fmsmga002-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Sep 2021 05:58:39 -0700 Subject: Re: [PATCH v2 10/12] ASoC: SOF: Intel: hda: make sure DAI widget is set up before IPC To: =?UTF-8?Q?P=c3=a9ter_Ujfalusi?= , 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: Pierre-Louis Bossart Message-ID: Date: Thu, 23 Sep 2021 07:58:36 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Firefox/78.0 Thunderbird/78.13.0 MIME-Version: 1.0 In-Reply-To: <203bf6cd-6407-f01d-52c3-e399d06cb3f6@linux.intel.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org >> +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.