Received: by 2002:a05:7412:e794:b0:fa:551:50a7 with SMTP id o20csp96244rdd; Mon, 8 Jan 2024 19:44:38 -0800 (PST) X-Google-Smtp-Source: AGHT+IGDOnp7+GAQBz+RASe+TY9vR/1Oj5ctePv/X+iibgJut7Z8uW/toMmmLlhl3/ViuD3eLuyM X-Received: by 2002:a05:6214:19e1:b0:67f:a3db:67cb with SMTP id q1-20020a05621419e100b0067fa3db67cbmr4917680qvc.73.1704771878779; Mon, 08 Jan 2024 19:44:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704771878; cv=none; d=google.com; s=arc-20160816; b=wX70fMvOUgCC+6QTXoRVG9Iv2Q7StlUZHWgXxFsQdD0MdSeuxm9HDZK/VQGhZo10s5 pXZ70KJh5vNd4WzDAq1T1M5dRKJrlRW5YCjdePEnhJcFOuvw1fyJl/O1OmCTmzcmqaMk V6BiAF0KbXN8iwRXz4yIxm6W/iQYUNJUxVui6O+hI8c+ZkHRRtieGxl413zvQgqkzLhb h8S50iIjP+5cMxNGEgJdn1Ar+wHhzzBAYVDp0HpWKI3EQfEgFjpRVyCLV4wgGhSCj4hT DqCJt7im9Q4EqtQojQ/mvSPyr6busCnKQtyVjArhu4Cb2lxXEbR8a9e7GZgt1amh62Oh 1Giw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=1IirnRXaj1MUEQGJO0zbDoWzQpnWpqMe52m35Flc2QA=; fh=IAGLCFy+AHW/sAXTwRsV+16WX+OnkCy9SGGWH+k6k1k=; b=v66w16MiloXbxzS8OQxuiwwihW/2Bl077nSu4vEk6s6hFrQ4sSsD2lkmpFqrJcEBDJ Jdn9s0TVWhLXSC5tNH+bFMkCE4nl1rOiDANF+EJNEkEbVAnFrLutkN3Fl2LsR1cLVrq3 vkTxlwqxmx4wOHGJdV1xzaNrLf5/KqFpqTTrXXdJCUO4jQsTn5n6zxiNKTEfD8eMGsq0 nnUY9L0Z0ltT6Qvnyb+svbCNTwHWfOtRQV1rC87Fkthlz59/00mVRIxtk8yP/RaH2mNy y7SIABZQMGhqWVoEmn7Fnhx49fOEtexvPVQZJ/l+lwRkZHKPhLedZ3U+M+MWLSTSJJAa 6leQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=izpz8q5M; spf=pass (google.com: domain of linux-kernel+bounces-20336-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-20336-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id r24-20020a0cb298000000b0067f753c0f73si1413315qve.278.2024.01.08.19.44.38 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Jan 2024 19:44:38 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-20336-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=izpz8q5M; spf=pass (google.com: domain of linux-kernel+bounces-20336-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-20336-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 85F4B1C231BB for ; Tue, 9 Jan 2024 03:44:38 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id ACBC446A8; Tue, 9 Jan 2024 03:44:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="izpz8q5M" Received: from mail-lj1-f178.google.com (mail-lj1-f178.google.com [209.85.208.178]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9CCCC63A4 for ; Tue, 9 Jan 2024 03:44:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Received: by mail-lj1-f178.google.com with SMTP id 38308e7fff4ca-2cd33336b32so32259601fa.0 for ; Mon, 08 Jan 2024 19:44:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1704771866; x=1705376666; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=1IirnRXaj1MUEQGJO0zbDoWzQpnWpqMe52m35Flc2QA=; b=izpz8q5MBW1FRzVC7qdMo3hQyPRbaEk4+TOL1ioe9j63uZUwoBqJxVCZFpjTuUfka0 KdSlAmoE5GNOpTdfpKrfyZ7eAxGcO+CxbOTmODMp0+u6IHygISfNWc10yChNUlN96ckg VNLrh/P3v+L/XcKKeiFahtPMxkhZAJ4yzQp4g= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704771866; x=1705376666; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=1IirnRXaj1MUEQGJO0zbDoWzQpnWpqMe52m35Flc2QA=; b=NgZbt4udW9q4CSiKz4B5VuRxrV9Uw+HNLvwnIa9OX2Mmgs2P9Lizjhnh4YsKdAURS6 EoE9MqLbdvkzRP22ai+XnRksAnIVgKlEGgVDEqttw2vf8tzr/3llW+r8T90i/d8ns4RA Ap9/W5V/paNLrTDIYp/drVlcSs8yCKKl6AWJwqvYswn5cILNMMkyYq2uIGz0IRcqyB6N samOWawbt55JttuPVi3tg+ueH/tCfFEvEU7+Y3VB2EqtoPuzKJJrUBvqsUk1O6+Za/Kh dRl3OhcB2tKsm458eFTPugDYIdsqKrkeZ+dYfSDGzXIDK+/OzxMpH1qN3D4DR3WDdzf1 UGBw== X-Gm-Message-State: AOJu0YyMdymdiklCnK3adVVx/YNTUbKtFcyK/1JvsOfqWKLMxdAAT7vI aLGiEfiOMztdQZUnNnG+vVTKiKrWd//jeH2hzTq/bn32SJVj X-Received: by 2002:a2e:9b18:0:b0:2cc:7718:edfe with SMTP id u24-20020a2e9b18000000b002cc7718edfemr2040200lji.41.1704771865390; Mon, 08 Jan 2024 19:44:25 -0800 (PST) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240108204508.691739-1-nfraprado@collabora.com> In-Reply-To: <20240108204508.691739-1-nfraprado@collabora.com> From: Chen-Yu Tsai Date: Tue, 9 Jan 2024 11:44:14 +0800 Message-ID: Subject: Re: [PATCH] ASoC: mediatek: mt8192: Check existence of dai_name before dereferencing To: =?UTF-8?B?TsOtY29sYXMgRi4gUi4gQS4gUHJhZG8=?= Cc: Mark Brown , AngeloGioacchino Del Regno , kernel@collabora.com, Jaroslav Kysela , Kuninori Morimoto , Liam Girdwood , Matthias Brugger , =?UTF-8?Q?N=C3=ADcolas_F=2E_R=2E_A=2E_Prado_via_Alsa=2Ddevel?= , Rob Herring , Takashi Iwai , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-sound@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Tue, Jan 9, 2024 at 4:47=E2=80=AFAM N=C3=ADcolas F. R. A. Prado wrote: > > Following commit 13f58267cda3 ("ASoC: soc.h: don't create dummy > Component via COMP_DUMMY()"), the dai_name field is only populated for > dummy components after the card is registered. This causes a null > pointer dereference in the mt8192-mt6359 sound card driver's probe > function when searching for a dai_name among all the card's dai links. > > Verify that the dai_name is non-null before passing it to strcmp. While > at it, also check that there's at least one codec. > > Reported-by: "kernelci.org bot" > Closes: https://linux.kernelci.org/test/case/id/6582cd6d992645c680e13478/ > Fixes: 13f58267cda3 ("ASoC: soc.h: don't create dummy Component via COMP_= DUMMY()") > Signed-off-by: N=C3=ADcolas F. R. A. Prado Reviewed-by: Chen-Yu Tsai Tested-by: Chen-Yu Tsai Audio now works again on my MT8192 Hayato.