All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: ASoC: dapm: Simplify list creation in dapm_dai_get_connected_widgets()
@ 2015-08-04 17:38 Dan Carpenter
  2015-08-04 18:51 ` Lars-Peter Clausen
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2015-08-04 17:38 UTC (permalink / raw)
  To: lars; +Cc: alsa-devel

Hello Lars-Peter Clausen,

The patch 1ce43acff0c0: "ASoC: dapm: Simplify list creation in
dapm_dai_get_connected_widgets()" from Jul 26, 2015, leads to the
following static checker warning:

	sound/soc/soc-dapm.c:1199 snd_soc_dapm_dai_get_connected_widgets()
	warn: inconsistent returns 'mutex:&card->dapm_mutex'.
	  Locked on:   line 1194
	  Unlocked on: line 1199

sound/soc/soc-dapm.c
  1164  int snd_soc_dapm_dai_get_connected_widgets(struct snd_soc_dai *dai, int stream,
  1165          struct snd_soc_dapm_widget_list **list)
  1166  {
  1167          struct snd_soc_card *card = dai->component->card;
  1168          struct snd_soc_dapm_widget *w;
  1169          LIST_HEAD(widgets);
  1170          int paths;
  1171          int ret;
  1172  
  1173          mutex_lock_nested(&card->dapm_mutex, SND_SOC_DAPM_CLASS_RUNTIME);
  1174  
  1175          /*
  1176           * For is_connected_{output,input}_ep fully discover the graph we need
  1177           * to reset the cached number of inputs and outputs.
  1178           */
  1179          list_for_each_entry(w, &card->widgets, list) {
  1180                  w->inputs = -1;
  1181                  w->outputs = -1;
  1182          }
  1183  
  1184          if (stream == SNDRV_PCM_STREAM_PLAYBACK)
  1185                  paths = is_connected_output_ep(dai->playback_widget, &widgets);
  1186          else
  1187                  paths = is_connected_input_ep(dai->capture_widget, &widgets);
  1188  
  1189          /* Drop starting point */
  1190          list_del(widgets.next);
  1191  
  1192          ret = dapm_widget_list_create(list, &widgets);
  1193          if (ret)
  1194                  return ret;
                        ^^^^^^^^^^^
Holding card->dapm_mutex.

  1195  
  1196          trace_snd_soc_dapm_connected(paths, stream);
  1197          mutex_unlock(&card->dapm_mutex);
  1198  
  1199          return paths;
  1200  }

regards,
dan carpenter

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: ASoC: dapm: Simplify list creation in dapm_dai_get_connected_widgets()
  2015-08-04 17:38 ASoC: dapm: Simplify list creation in dapm_dai_get_connected_widgets() Dan Carpenter
@ 2015-08-04 18:51 ` Lars-Peter Clausen
  0 siblings, 0 replies; 2+ messages in thread
From: Lars-Peter Clausen @ 2015-08-04 18:51 UTC (permalink / raw)
  To: Dan Carpenter; +Cc: alsa-devel

On 08/04/2015 07:38 PM, Dan Carpenter wrote:
> Hello Lars-Peter Clausen,
> 
> The patch 1ce43acff0c0: "ASoC: dapm: Simplify list creation in
> dapm_dai_get_connected_widgets()" from Jul 26, 2015, leads to the
> following static checker warning:
> 
> 	sound/soc/soc-dapm.c:1199 snd_soc_dapm_dai_get_connected_widgets()
> 	warn: inconsistent returns 'mutex:&card->dapm_mutex'.
> 	  Locked on:   line 1194
> 	  Unlocked on: line 1199
> 

Thanks, I'll send a fix.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-08-04 18:51 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-08-04 17:38 ASoC: dapm: Simplify list creation in dapm_dai_get_connected_widgets() Dan Carpenter
2015-08-04 18:51 ` Lars-Peter Clausen

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.