From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7DBD2369D4E; Wed, 20 May 2026 16:40:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779295254; cv=none; b=noFgI9QH972R4MyHGxI3+kLgaZ17I2MG43TaJbWMNboNdmvNFr/kk8iscxR2mNJgHnAFB0lsaf1X4MB+r9xFdZ2wR0KcKABUlQGqQs3toXHe6EwUoPZfe7h32ml0vGYHkXTI80lc872m0o6bLkLZp1Iu6AjF0kLcvMjEsfKBZ8Q= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779295254; c=relaxed/simple; bh=Hqal4/aqtGdJB9hAnmTnWrFyWg5Sf4yXvZkI871Yk9E=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=lLZcv2+K26MphK5TyLcBWcadKtVll0I0A1c3oM0MpZOmHbM2I1+3J8bJqu/hmepHgwFuXoGaI8I1o/CrtrejPYeI/awWCAUDltKowgn5Vf3eI+/p6ORKdKGlALLx8Nq3gRCdpUZU9OuSLpS28m9U0IHrFKv8+SNHOAC8LSOj7ao= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=cbO4SdDx; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="cbO4SdDx" Received: by smtp.kernel.org (Postfix) with ESMTPSA id E3D261F00893; Wed, 20 May 2026 16:40:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1779295253; bh=4YnG76t9Fz8ndFO9q8pKhZONZe/VjGbahjy/53CdV7Y=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=cbO4SdDxcNvSHa5OySyJSN7uT3SFTl9I2ZX7NsgBiPElW03LLFdZPv3WMl0l97zyM WoJZ2BG/ioX1Yk2/EeJSmwoLTp9YuhY7fghrSVy2/eeieGoNQW2YJOTzFLSTmfQhNv mCMEE3Wr4rSg7exb6SmxVpLyHm1eqBUUU2b5eOHA= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Ethan Tidmore , Mark Brown , Sasha Levin Subject: [PATCH 7.0 0350/1146] ASoC: SOF: Intel: hda: Place check before dereference Date: Wed, 20 May 2026 18:10:00 +0200 Message-ID: <20260520162156.121400753@linuxfoundation.org> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20260520162148.390695140@linuxfoundation.org> References: <20260520162148.390695140@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 7.0-stable review patch. If anyone has any objections, please let me know. ------------------ From: Ethan Tidmore [ Upstream commit 6cbc8360f51a3df2ea16a786b262b9fe44d4c68c ] The struct hext_stream is dereferenced before it is checked for NULL. Although it can never be NULL due to a check prior to hda_dsp_iccmax_stream_hw_params() being called, this change clears any confusion regarding hext_stream possibly being NULL. Check hext_stream for NULL and then assign its members. Detected by Smatch: sound/soc/sof/intel/hda-stream.c:488 hda_dsp_iccmax_stream_hw_params() warn: variable dereferenced before check 'hext_stream' (see line 486) Fixes: aca961f196e5d ("ASoC: SOF: Intel: hda: Add helper function to program ICCMAX stream") Signed-off-by: Ethan Tidmore Link: https://patch.msgid.link/20260324173830.17563-1-ethantidmore06@gmail.com Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- sound/soc/sof/intel/hda-stream.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/sound/soc/sof/intel/hda-stream.c b/sound/soc/sof/intel/hda-stream.c index 1c04b5d9c0d8b..5c1f3b427cdb8 100644 --- a/sound/soc/sof/intel/hda-stream.c +++ b/sound/soc/sof/intel/hda-stream.c @@ -480,16 +480,20 @@ int hda_dsp_iccmax_stream_hw_params(struct snd_sof_dev *sdev, struct hdac_ext_st struct snd_dma_buffer *dmab, struct snd_pcm_hw_params *params) { - struct hdac_stream *hstream = &hext_stream->hstream; - int sd_offset = SOF_STREAM_SD_OFFSET(hstream); + struct hdac_stream *hstream; + int sd_offset; int ret; - u32 mask = 0x1 << hstream->index; + u32 mask; if (!hext_stream) { dev_err(sdev->dev, "error: no stream available\n"); return -ENODEV; } + hstream = &hext_stream->hstream; + sd_offset = SOF_STREAM_SD_OFFSET(hstream); + mask = 0x1 << hstream->index; + if (!dmab) { dev_err(sdev->dev, "error: no dma buffer allocated!\n"); return -ENODEV; -- 2.53.0