ASoC: SOF: Intel: hda-stream: Fix hext_stream dereferenced before check
Subsystems (3)
PATCH 1/1 ASoC: SOF: Intel: hda-stream: Fix hext_stream dereferenced before check
hext_stream dereferenced before check:
int hda_dsp_iccmax_stream_hw_params(...,
struct hdac_ext_stream *hext_stream,...)
{
struct hdac_stream *hstream = &hext_stream->hstream;
^^^^^^^^^^^^^^^^^^^^
Dereferenced
...
if (!hext_stream) {
^^^^^^^^^^^^
Checked too late.
dev_err(sdev->dev, "error: no stream available\n");
return -ENODEV;
}
...
}The caller hda_cl_prepare() guarantees that the parameter hext_stream passed to hda_dsp_iccmax_stream_hw_params() is non-NULL. Finally, we don't need to check the hext_stream and it should be valid. Removes the hext_stream check.
Signed-off-by Zhen Ni <[email protected]>
--- sound/soc/sof/intel/hda-stream.c | 5 ----- 1 file changed, 5 deletions(-)
sound/soc/sof/intel/hda-stream.c +0 -5
@@ -450,11 +450,6 @@ int hda_dsp_iccmax_stream_hw_params(struct snd_sof_dev *sdev, struct hdac_ext_stint ret;u32 mask =0x1 << hstream->index; -if (!hext_stream) { -dev_err (sdev->dev,"error: no stream available\n" ); -return -ENODEV ; - } -if (!dmab) {dev_err (sdev->dev,"error: no dma buffer allocated!\n" );return -ENODEV ;
Signature · 1 line
2.20.1