Received: by 2002:a05:6a10:2785:0:0:0:0 with SMTP id ia5csp3042791pxb; Tue, 12 Jan 2021 05:06:04 -0800 (PST) X-Google-Smtp-Source: ABdhPJxvWgj9ovCSeQClAL0vH6r+5hoUlCa24yOsmUVsfCU8GdsYXfjU47lzws03H9USqmhKa+Jl X-Received: by 2002:a17:906:b7cc:: with SMTP id fy12mr3235413ejb.390.1610456763827; Tue, 12 Jan 2021 05:06:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610456763; cv=none; d=google.com; s=arc-20160816; b=uH5mfJyxaEts6mVa9YP4TUJqLLIb/tV9YMjS/9ctupPt4JEyiiCtl7KKxxEVfQ+ZSj kky+QRJR4wHrr/htIMC4Ii2HpFQEAmf7q0dzh8hXVZtvpSWFxzVko/+jmO4rmdwOp6Fe 0L1UV+O7vLnquo25KfBPykK2Yyj36kiVVCjyILobSkRlLvRlGCYaSrrx5yDT4ZnahsdF VRHfKa2eox/ZJp9zgQr6he9DcPNORqaqcvAzJSfyutmCvI6I5ip90OoENO5Jpmb66M// ZzCCSgV3/MHEGCPt3u7yFdNLGo19mURlzWIQZbHznoZwaUO1PcIUn7zg9U7x9naeQqaC Y4Yw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=BAPb6vexy0PxRtXiUa5L0zEXfbkLceHCVsv7ebs5b1k=; b=hL1IWf/xyV4klCDS4R7Z0GkN/sISU5OZdNS6rs6/dekW1DctUzSfpIX2mXggeCg5aa N4fhCqAWlwlZWacWnlcXjcMqKOE5VBpOaqTELCV3UcP9ZJJQxr0F47EDtqcRz8tt/z5u BMhUkGGiObW/TN0lM5NIc+bbC+aw1613XsHwuM2sa/u8EUOUCXBqUDLQDhdCBv0Uix3s PgsPptIK/sPrvzigtkf5N2lFdEItIqIgkOUgZOUWekm3++g2LPG6eARRhiM213p36NdM TkEkfgYnLF9LVe27HKUKkcCpOCPaAkv9qcQs9b3bDqcIgQftbFZ3vVYwjsWvHRQtURXV qGtA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@semihalf-com.20150623.gappssmtp.com header.s=20150623 header.b=zi6iaFuV; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a16si1256493ejk.668.2021.01.12.05.05.34; Tue, 12 Jan 2021 05:06:03 -0800 (PST) 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; dkim=pass header.i=@semihalf-com.20150623.gappssmtp.com header.s=20150623 header.b=zi6iaFuV; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729222AbhALLfI (ORCPT + 99 others); Tue, 12 Jan 2021 06:35:08 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55740 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728953AbhALLfH (ORCPT ); Tue, 12 Jan 2021 06:35:07 -0500 Received: from mail-qk1-x731.google.com (mail-qk1-x731.google.com [IPv6:2607:f8b0:4864:20::731]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 53C70C061795 for ; Tue, 12 Jan 2021 03:34:27 -0800 (PST) Received: by mail-qk1-x731.google.com with SMTP id f26so1557884qka.0 for ; Tue, 12 Jan 2021 03:34:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=semihalf-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=BAPb6vexy0PxRtXiUa5L0zEXfbkLceHCVsv7ebs5b1k=; b=zi6iaFuVYuUiKP2K8cPgOTQZ7OFwrTgmdC5T6KZgeikQEjRkOhtCbM4wKpyailZafU riOSqnVptS+vJJKV1UrBRFX66IHFMZCkFU+hZri2g/EljddrUUIY410Eh4RgOPCB026f GUsbErOQkL5zBFFSss88s0ovOkkP8UJaNmzBgSFOJavm0et8cuKqH1t0yru2F6ZestrN rf9umHxtU7XCCh0sSm2Yy5fFARZXc0GgZrcCScLWV8LxNmXSFFv/keQgz5HYIcDN1E5O 8Mgy2FHcY1e6THAiPpzNw+NPLg953O+yN4SAXNUiXw6J9qaxC1lRk3bjEpiBaX25G/oH uUtg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=BAPb6vexy0PxRtXiUa5L0zEXfbkLceHCVsv7ebs5b1k=; b=SNiC6ZlU0Ib8WkNJg8QElY6pnm8xKph2l7C5Rh9DaKH9OxvkaL9Iffgff1Gp4G4ENB dRGWkS+yMGgqjk0Vdsf98c9diXDrzwnl6nwqdragwk/DXl7jh3SrQvUy//5sNvUFlRqL Lal1yNZv3dflAdgNXY7cfpqnWWy3EYIoqNp5HDU9RDYR7LYwhf3uchPB5P1gXj/z6zt5 N69NChD+Nog3An7gf8WH/+z2PRIYZT11hUQy+CdHGdDT5cvKHyOe8an2K/KO0qwrDALx t+LLMn9U71AGqi8myNfI5iwCgrobWOl3laKZQW+oUmMMGxHv+3uly73pjiAcbJNr9yB5 EsRw== X-Gm-Message-State: AOAM531iPiEHIjpSotfDAPay8g84yh7MOPRjG3PegEVvqrqUoU5ICAAh qBxag0Zo9lF57DFWv4MdCuBERiEyX1hRCjAigyyV/w== X-Received: by 2002:a37:418d:: with SMTP id o135mr4180829qka.426.1610451266538; Tue, 12 Jan 2021 03:34:26 -0800 (PST) MIME-Version: 1.0 References: <20201210121438.7718-1-lma@semihalf.com> <20201217130439.141943-1-lma@semihalf.com> In-Reply-To: <20201217130439.141943-1-lma@semihalf.com> From: =?UTF-8?Q?=C5=81ukasz_Majczak?= Date: Tue, 12 Jan 2021 12:34:15 +0100 Message-ID: Subject: Re: [PATCH v2] ASoC: Intel: Skylake: Check the kcontrol against NULL To: Pierre-Louis Bossart , Liam Girdwood , Mateusz Gorski Cc: Marcin Wojtas , Radoslaw Biernacki , Alex Levin , Guenter Roeck , alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, This is just a kind reminder. Is there anything more required to upstream this patch? Best regards, Lukasz czw., 17 gru 2020 o 14:06 Lukasz Majczak napisa=C5=82(a)= : > > There is no check for the kcontrol against NULL and in some cases > it causes kernel to crash. > > Fixes: 2d744ecf2b984 ("ASoC: Intel: Skylake: Automatic DMIC format config= uration according to information from NHLT") > Cc: # 5.4+ > Signed-off-by: Lukasz Majczak > Reviewed-by: Mateusz Gorski > --- > sound/soc/intel/skylake/skl-topology.c | 14 ++++++++++---- > 1 file changed, 10 insertions(+), 4 deletions(-) > v1 -> v2: fixed coding style > > diff --git a/sound/soc/intel/skylake/skl-topology.c b/sound/soc/intel/sky= lake/skl-topology.c > index ae466cd592922..8f0bfda7096a9 100644 > --- a/sound/soc/intel/skylake/skl-topology.c > +++ b/sound/soc/intel/skylake/skl-topology.c > @@ -3618,12 +3618,18 @@ static void skl_tplg_complete(struct snd_soc_comp= onent *component) > int i; > > list_for_each_entry(dobj, &component->dobj_list, list) { > - struct snd_kcontrol *kcontrol =3D dobj->control.kcontrol; > - struct soc_enum *se =3D > - (struct soc_enum *)kcontrol->private_value; > - char **texts =3D dobj->control.dtexts; > + struct snd_kcontrol *kcontrol; > + struct soc_enum *se; > + char **texts; > char chan_text[4]; > > + kcontrol =3D dobj->control.kcontrol; > + if (!kcontrol) > + continue; > + > + se =3D (struct soc_enum *)kcontrol->private_value; > + texts =3D dobj->control.dtexts; > + > if (dobj->type !=3D SND_SOC_DOBJ_ENUM || > dobj->control.kcontrol->put !=3D > skl_tplg_multi_config_set_dmic) > -- > 2.25.1 >