[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <7016fcb5-329d-44f1-967b-3059e059aeb9@sirena.org.uk>
Date: Tue, 5 Nov 2024 19:07:07 +0000
From: Mark Brown <broonie@...nel.org>
To: Suraj Sonawane <surajsonawane0215@...il.com>
Cc: Péter Ujfalusi <peter.ujfalusi@...ux.intel.com>,
daniel.baluta@....com, kai.vehmanen@...ux.intel.com,
lgirdwood@...il.com, linux-kernel@...r.kernel.org,
linux-sound@...r.kernel.org, perex@...ex.cz,
pierre-louis.bossart@...ux.dev, ranjani.sridharan@...ux.intel.com,
sound-open-firmware@...a-project.org, tiwai@...e.com,
yung-chuan.liao@...ux.intel.com
Subject: Re: [PATCH v2] sound: fix uninit-value in
sof_ipc4_pcm_dai_link_fixup_rate
On Tue, Nov 05, 2024 at 04:20:23PM +0530, Suraj Sonawane wrote:
> Thank you, Mark and Péter, for the guidance. I understand now that, while
> the copier should always have at least one input format, static analysis
> tools can’t detect this. Based on your suggestions, I’ve considered the
> following possible solutions to address the issue:
> 1. Add a WARN_ON_ONCE(!num_input_formats) check: This would issue a warning
> and return an error if num_input_formats is unexpectedly zero, ensuring we
> handle any edge cases explicitly.
> 2. Return an error if no input formats are available: Implementing the
> following check could provide immediate feedback if num_input_formats is
> zero:
> if (num_input_formats <= 0) {
> dev_err(sdev->dev, "No input formats available\n");
> return -EINVAL; // Return an error if there are no formats
> }
> Would it be preferable to proceed with the WARN_ON_ONCE(!num_input_formats)
> approach, or is there a preferred alternative from the options above?
I don't have a super strong preference between the two options.
Download attachment "signature.asc" of type "application/pgp-signature" (489 bytes)
Powered by blists - more mailing lists