All of lore.kernel.org
 help / color / mirror / Atom feed
* [bug report] ASoC: soc-dai: return proper error for get_sdw_stream()
@ 2020-07-17  9:40 dan.carpenter
  0 siblings, 0 replies; only message in thread
From: dan.carpenter @ 2020-07-17  9:40 UTC (permalink / raw)
  To: srinivas.kandagatla; +Cc: alsa-devel

Hello Srinivas Kandagatla,

The patch 308811a327c3: "ASoC: soc-dai: return proper error for
get_sdw_stream()" from Mar 16, 2020, leads to the following static
checker warning:

	drivers/soundwire/stream.c:1920 sdw_shutdown_stream()
	error: 'sdw_stream' dereferencing possible ERR_PTR()

drivers/soundwire/stream.c
  1902  void sdw_shutdown_stream(void *sdw_substream)
  1903  {
  1904          struct snd_pcm_substream *substream = sdw_substream;
  1905          struct snd_soc_pcm_runtime *rtd = substream->private_data;
  1906          struct sdw_stream_runtime *sdw_stream;
  1907          struct snd_soc_dai *dai;
  1908  
  1909          /* Find stream from first CPU DAI */
  1910          dai = asoc_rtd_to_cpu(rtd, 0);
  1911  
  1912          sdw_stream = snd_soc_dai_get_sdw_stream(dai, substream->stream);
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
We updated this to return error pointers as well as NULL but forgot to
check the caller.

  1913  
  1914          if (!sdw_stream) {
  1915                  dev_err(rtd->dev, "no stream found for DAI %s", dai->name);
  1916                  return;
  1917          }
  1918  
  1919          /* release memory */
  1920          kfree(sdw_stream->name);
  1921          sdw_release_stream(sdw_stream);
  1922  

regards,
dan carpenter

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-07-17  9:46 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-17  9:40 [bug report] ASoC: soc-dai: return proper error for get_sdw_stream() dan.carpenter

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.