From nobody Fri Apr 3 10:04:17 2026 Received: from mail-yw1-f180.google.com (mail-yw1-f180.google.com [209.85.128.180]) (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 548E03F8815 for ; Tue, 24 Mar 2026 17:38:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.180 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774373915; cv=none; b=MeT6LcQ6MORgQ2iWkGpBeHEp6tfLUvmxW55L+KhWQacos8LSFHAuIeHPp/Q4fqj9cY0JoV5wzu6nLVqDWBMHGbbU7Zc1CDJn2u+966LFrwJozqgt8orlftIhvmshsQ3kIQkDFQ35jLfqsi2KX/ptucNYDLUjl0glpXJhy+PbNZA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774373915; c=relaxed/simple; bh=VbYIDIazuAKliHd4gaVoOEnfMt94rZKAwng2qMST6KY=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=Hpb/xBbIm6QnB9Lrrs3LiSlJoqy68B6IU7uS0zLUsqldwanNHDMRTyJPRXX1DA0DT7j21Q8LHtl9gc8GPcWP9TiW5kVzrNIqi6ROQJekB2RT1KgG9VVSIsYYqOaCqDPj2fwpeuC8/rc+WpNzeMyQkW76wBWNIXBouJjGUp0t/2M= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=oSxO9AoB; arc=none smtp.client-ip=209.85.128.180 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="oSxO9AoB" Received: by mail-yw1-f180.google.com with SMTP id 00721157ae682-79885f4a8ffso48707327b3.3 for ; Tue, 24 Mar 2026 10:38:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1774373913; x=1774978713; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=Zhk7eb8OjjvNFySWuiOYIrFwWI2N+A/k+Z8JkVgJz4g=; b=oSxO9AoBNU+CUrWJR37HeNz9pJsuG3erxVGYuN0vuMxhtxq+nH16YJsjZ86twS4NJO c8c2f3o0JOFc19rSeNt9lJj+1JLHAD1coucfoj/nTClFlD5xQ2VrigcHno2H6iX1xYeP 0Rso8rsRxdhQhXBo8tb/t1TfS3tgguCdYhLP203FmsjZYmRi24wCyNp/fxYxOo9ovYvl iIMzwKSexHUIGaGEh3MJEHHHDClhONQcHgMHMUFN8pjKcDpMKHnYksxC2+GYYcJBu2Td irrGYThf6vUeJKp5CP34Act/KEzBJDXWzm1Vezw+Cbk+USdu7hupjCC9es3o6ycmfP5I lqIA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1774373913; x=1774978713; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=Zhk7eb8OjjvNFySWuiOYIrFwWI2N+A/k+Z8JkVgJz4g=; b=jZUMN8odiRN5atUf+FYskBrOFGzvQ6j328CbXYvhGTou2gZcToVSp0lUYQx8bAM1R+ k3K3Rlp+dY7rKtdFF6ZFth/vbMKWMuC4eDlP336iAK4dQL/phzPTQbwXOZ9RyJIHvq2d 7JiS34FDokAxLwci4+DVJ7UO2fcrsXrw/U27uyCwsxuPMpzB4CBfs63uJxThPhZzUfgr Z5qC1+m32kh/2z1dC8ghVo4vgMF3DmSPHsi0r4OjKkOkUuPD+zb8Tpfd17+75RLnaIPb u2PR415A1xcEcvbGzr6XPoUdlCqGo6JVmprilTlXm0wqaSDqL4yNRtDAqGoJX/dyPuSh lzTw== X-Forwarded-Encrypted: i=1; AJvYcCVkqd2r1o57qppYNfvphI6Ob5Vg9xkbv+vSgvqDKdOSgG/PRoPFb9Kan6obtm+Co2XZyua8ZAFjGzULPdU=@vger.kernel.org X-Gm-Message-State: AOJu0YxI9VXHDfAyEQzSIU/Re5immGLJz71Cf08vcI7EWWozrXdrp+VF B9BPzzxz8gE+GWQijbMmm9Hl4x3EyBQxnWSQjeXS7SSf7lmMlpaLSpnX X-Gm-Gg: ATEYQzyEfbg6ZpDqRclJGg78Gce0NlNxyjl0cmSVgMNw+A+8z8Yq4EFAQte/UarU/M/ uyHfP4luh1R1kxWCDqt5jc9vXmsMJTeFOiZ/uss46uoy0RVk8b6ffERFmulo6/clFt6UUC8LidJ s37JYf2SAvpOER4EWwJ6TH83H8ab32pQcwHpxszvOgdjbmE1966OPHzs1Oq56cYtrCzjx0+RVV9 SIXeyVyJJTibBB6omYS0mIl3HNrT4EwHY4v7f7XDxqnKIqQC0LwZt42ddFHTD3SeYivnNy41vyT LyJVtdtNwAB4IXydqxI7H+9L0YS8FtO6uTmgP0vUjiFSxLMSvzGl6dL+wza7hkQHuxeYEyVqMCm keJ4+38rPqaNQVikIewRJ8RWKSFKQHVvgzuK8xri6Cg3xd9USge2K2k5T0EZBdW/EKnxUEX1Iny x9lzWig9G2j2Q6zxyLb59VAmtfHsqau6lzPxythHfB7PA4kpBBNHbn99BwRndWHRmBvE2isx9fb BC1iSh5uuMBfQhEWAAqQv9stCeZrKiK2gw= X-Received: by 2002:a05:690c:9988:b0:79a:c7f8:d98c with SMTP id 00721157ae682-79acf614bccmr6487657b3.38.1774373913333; Tue, 24 Mar 2026 10:38:33 -0700 (PDT) Received: from tux ([2601:7c0:c37e:2360::17e2]) by smtp.gmail.com with ESMTPSA id 00721157ae682-79a903a6e9asm74563487b3.10.2026.03.24.10.38.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Mar 2026 10:38:32 -0700 (PDT) From: Ethan Tidmore To: Mark Brown , Ranjani Sridharan Cc: Liam Girdwood , Peter Ujfalusi , Bard Liao , Daniel Baluta , Kai Vehmanen , Pierre-Louis Bossart , Jaroslav Kysela , Takashi Iwai , Colin Ian King , Guennadi Liakhovetski , sound-open-firmware@alsa-project.org, linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org, Ethan Tidmore Subject: [PATCH] ASoC: SOF: Intel: hda: Place check before dereference Date: Tue, 24 Mar 2026 12:38:30 -0500 Message-ID: <20260324173830.17563-1-ethantidmore06@gmail.com> X-Mailer: git-send-email 2.53.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 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 progra= m ICCMAX stream") Signed-off-by: Ethan Tidmore --- 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-str= eam.c index 1c04b5d9c0d8..5c1f3b427cdb 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_de= v *sdev, struct hdac_ext_st struct snd_dma_buffer *dmab, struct snd_pcm_hw_params *params) { - struct hdac_stream *hstream =3D &hext_stream->hstream; - int sd_offset =3D SOF_STREAM_SD_OFFSET(hstream); + struct hdac_stream *hstream; + int sd_offset; int ret; - u32 mask =3D 0x1 << hstream->index; + u32 mask; =20 if (!hext_stream) { dev_err(sdev->dev, "error: no stream available\n"); return -ENODEV; } =20 + hstream =3D &hext_stream->hstream; + sd_offset =3D SOF_STREAM_SD_OFFSET(hstream); + mask =3D 0x1 << hstream->index; + if (!dmab) { dev_err(sdev->dev, "error: no dma buffer allocated!\n"); return -ENODEV; --=20 2.53.0