From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f68.google.com (mail-wm1-f68.google.com [209.85.128.68]) (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 C60F72D879B for ; Tue, 10 Feb 2026 08:52:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.68 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770713524; cv=none; b=QGQ4K9XxrPE4FPbBWOoN2DdkbQhFGrY1BRFJu5A9TFiaObt37W/7oRVLNrACZPckpJfKlFLCVeCtZ8dYbgHOQue5TEx74Xhb1D1yi6xjjXHq9m8NBSHLaBLG9H8TlcSYjFbYEK1oRYr/Dn8QFhPo6/s9ZVfo9+wodLG50nwJBy8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770713524; c=relaxed/simple; bh=6bxSCRQjKfdz1kx/1+7y+FWItuyvamgzcwltHnv3Oik=; h=Date:From:To:Cc:Subject:Message-ID:MIME-Version:Content-Type: Content-Disposition:In-Reply-To; b=fdbSke5Ja9SDHrIEoGYmJZQ1PIMy4JBhPv6CAx8HUSWkn6voSKxJ4d1x7SxbyRo5CduPgZlbXu06d8/3CJd0HXtCqaIKWpwlcpe9OkirFQSR+wmB2mllMqAwHaDXYimE8eR4eA69DlfdJgx03a9ei2xcy1QYoDXUyYaduUzqiQU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=LIIFZvRf; arc=none smtp.client-ip=209.85.128.68 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="LIIFZvRf" Received: by mail-wm1-f68.google.com with SMTP id 5b1f17b1804b1-482f2599980so6524375e9.0 for ; Tue, 10 Feb 2026 00:52:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1770713521; x=1771318321; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:message-id:subject:cc :to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=ggQrZbIS00PuyIC/VAAyPH4Kb3amYUqQ1eGorEAsp18=; b=LIIFZvRfBz32GWLTMFIRx4TjRIDezEDMdAbGnMVDxpHghqY6CHb6zFAYryETB9J87L wh3UipGMb2D8Zb4h9Sn4Nmp0i3hRSHfMdmf7a0lHMiTCfpHW9DPs99dICbH0OP/QeM8k 7kJCtwyqCv9yNPuzO8yLj9SEooZAwksFT95T5GPujDpmOm57MQXmE2TkPl8MBbYITyUM FUCtfMGgdeuAJ7stN0VzRBL5fFmG0f2oWCwueDQWqVvw1Bo/bqkrjFBa4EDNNK4z7b48 yBAkD3uOdiVOgqk5tl7OmiItuvfcfzc5adInSCTVPd5jkW6M0vMnFv6OfSKkwkFGZHzJ 4rcQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1770713521; x=1771318321; h=in-reply-to:content-disposition:mime-version:message-id:subject:cc :to:from:date:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=ggQrZbIS00PuyIC/VAAyPH4Kb3amYUqQ1eGorEAsp18=; b=Y6TLRGos+m7JVoIdDRKGDWBxEPV/NX9HUzRloS38W854CI0DMZDC32R/eDryVHN2U2 JRjVZYAHunStw/dMakHbGSRotzk7VhITiJqLhAzrGHhzCKwtIV4/p55Wu5p95Yu/niep H6zi+TEDaSV9hZP3ePYwU90ScKRZFhGvdMi1QPLVkhr6Y15omCglP/tgEXpyeIympP5q 8IInfcPrKhpP4DmWYCZR18m3XfVL9nwwd/A0CsLX32sJcP1np79Nw5uPdaCfXdXigCME eNRygMLuzFh0zA7a6q9G1wvs2ZMK34G/fCZM+EYWxLsNavB+8aHlTO8VbhZ3U449ScIB TqBA== X-Forwarded-Encrypted: i=1; AJvYcCWcsZeIzn4YLSGC38sypU8W3FES1eibi7gE23WCbNoiARZliWj0zFXODByyoYirOgMjFka5FQVxmI1a0kY=@vger.kernel.org X-Gm-Message-State: AOJu0YyrIuE3Zt6WzKX0NitH1nkj8qkPjZni2x+RLFjfRzrXi8TnlfOa SQDr0PMoEMujp6pFrexvuSkOvYErLiEstGGr2ulkm0rgE34Wy74UQVvns2GvOVGaTBM= X-Gm-Gg: AZuq6aIR4mIR1Pg0e+rtZU4cENP6y05+m3niporyGLJm8Gy3D+Lf9trMwow/RQ5Q6zY eoRNYB2qbx+shWugjxTFwFZvog5h7AvcOomTTe7CD5l6qnUUfqoBhZbQQsnF5Cz+VEJ76QsyUnd GjTQEPJoE8WWq7mRB/0k4c0nIeSKyJ/vfcJULqfb+Bjk6iXerWBTDdNLaIvfIWJS2v/wATHtMeU cVVtlKx75ubkouC9MXea80l6eEmhEjCtg5Dct7RP2XgAD3FceDROLp8aMpHUax/pfQlLXuiH+r8 yjFEcNGI7Zwpotrqzds0EbCjYVcYlbFTuw9c+KI6y2cCmLvqvIThckq8ISFJvtu7pFRKmgXGsGs SqnHiZVtp64bYH/7My/G0eRjhsORrlQ6Th5mbdJ0D7oviBPhgWV0IxxvPYEHBnCC7UiDfwffw4b mtB5KwbsqexNPGCuMYH5XwSwzrb+Tw X-Received: by 2002:a05:600c:3e19:b0:483:5310:dc43 with SMTP id 5b1f17b1804b1-4835310ddedmr8808095e9.32.1770713520986; Tue, 10 Feb 2026 00:52:00 -0800 (PST) Received: from localhost ([196.207.164.177]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-436296b2ed9sm33056703f8f.5.2026.02.10.00.52.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Feb 2026 00:52:00 -0800 (PST) Date: Tue, 10 Feb 2026 11:51:57 +0300 From: Dan Carpenter To: Ranjani Sridharan Cc: sound-open-firmware@alsa-project.org, linux-sound@vger.kernel.org, linux-kernel Subject: [bug report] ASoC: SOF: sof-audio: Add support for loopback capture Message-ID: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: [ Smatch checking is paused while we raise funding. #SadFace https://lore.kernel.org/all/aTaiGSbWZ9DJaGo7@stanley.mountain/ -dan ] Hello Ranjani Sridharan, Commit c4b37c21c75d ("ASoC: SOF: sof-audio: Add support for loopback capture") from Feb 4, 2026 (linux-next), leads to the following Smatch static checker warning: sound/soc/sof/sof-audio.c:534 sof_prepare_widgets_in_path() error: uninitialized symbol 'widget_ops'. sound/soc/sof/sof-audio.c 478 static int 479 sof_prepare_widgets_in_path(struct snd_sof_dev *sdev, struct snd_soc_dapm_widget *widget, 480 struct snd_pcm_hw_params *fe_params, 481 struct snd_sof_platform_stream_params *platform_params, 482 struct snd_pcm_hw_params *pipeline_params, int dir, 483 struct snd_soc_dapm_widget_list *list) 484 { 485 const struct sof_ipc_tplg_ops *tplg_ops = sof_ipc_get_ops(sdev, tplg); 486 struct snd_sof_widget *swidget = widget->dobj.private; 487 const struct sof_ipc_tplg_widget_ops *widget_ops; 488 struct snd_soc_dapm_path *p; 489 int ret; 490 491 if (is_virtual_widget(sdev, widget, __func__)) 492 return 0; 493 494 if (!swidget) 495 goto sink_prepare; ^^^^^^^^^^^^^^^^^ widget_ops is uninitialized. 496 497 widget_ops = tplg_ops ? tplg_ops->widget : NULL; 498 if (!widget_ops) 499 return 0; 500 501 if (swidget->spipe && swidget->spipe->direction_valid && 502 !sof_widget_in_same_direction(swidget, dir)) 503 return 0; 504 505 /* skip widgets already prepared or aggregated DAI widgets*/ 506 if (!widget_ops[widget->id].ipc_prepare || swidget->prepared || 507 is_aggregated_dai(swidget)) 508 goto sink_prepare; 509 510 /* prepare the source widget */ 511 ret = widget_ops[widget->id].ipc_prepare(swidget, fe_params, platform_params, 512 pipeline_params, dir); 513 if (ret < 0) { 514 dev_err(sdev->dev, "failed to prepare widget %s\n", widget->name); 515 return ret; 516 } 517 518 swidget->prepared = true; 519 520 sink_prepare: 521 /* prepare all widgets in the sink paths */ 522 snd_soc_dapm_widget_for_each_sink_path(widget, p) { 523 if (!widget_in_list(list, p->sink)) 524 continue; 525 526 if (!p->walking && p->sink->dobj.private) { 527 p->walking = true; 528 ret = sof_prepare_widgets_in_path(sdev, p->sink, fe_params, 529 platform_params, pipeline_params, dir, 530 list); 531 p->walking = false; 532 if (ret < 0) { 533 /* unprepare the source widget */ --> 534 if (widget_ops[widget->id].ipc_unprepare && 535 swidget && swidget->prepared && swidget->use_count == 0) { We need to check that swidget is non-NULL first before checking widget_ops[widget->id].ipc_unprepare, otherwise widget_ops is uninitialized and it leads to a crash. Wait, the zero day bot already reported this on Jan 5th. https://lore.kernel.org/all/202512232221.Ub3HwrFz-lkp@intel.com/ 536 widget_ops[widget->id].ipc_unprepare(swidget); 537 swidget->prepared = false; 538 } 539 return ret; 540 } 541 } 542 } 543 544 return 0; 545 } regards, dan carpenter