@@ -888,8 +888,9 @@ static int snd_pcm_free(struct snd_pcm *pcm)
888
888
889
889
if (!pcm )
890
890
return 0 ;
891
- list_for_each_entry (notify , & snd_pcm_notify_list , list ) {
892
- notify -> n_unregister (pcm );
891
+ if (!pcm -> internal ) {
892
+ list_for_each_entry (notify , & snd_pcm_notify_list , list )
893
+ notify -> n_unregister (pcm );
893
894
}
894
895
if (pcm -> private_free )
895
896
pcm -> private_free (pcm );
@@ -1129,7 +1130,7 @@ static int snd_pcm_dev_disconnect(struct snd_device *device)
1129
1130
mutex_lock (& pcm -> open_mutex );
1130
1131
wake_up (& pcm -> open_wait );
1131
1132
list_del_init (& pcm -> list );
1132
- for (cidx = 0 ; cidx < 2 ; cidx ++ )
1133
+ for (cidx = 0 ; cidx < 2 ; cidx ++ ) {
1133
1134
for (substream = pcm -> streams [cidx ].substream ; substream ; substream = substream -> next ) {
1134
1135
snd_pcm_stream_lock_irq (substream );
1135
1136
if (substream -> runtime ) {
@@ -1139,8 +1140,10 @@ static int snd_pcm_dev_disconnect(struct snd_device *device)
1139
1140
}
1140
1141
snd_pcm_stream_unlock_irq (substream );
1141
1142
}
1142
- list_for_each_entry (notify , & snd_pcm_notify_list , list ) {
1143
- notify -> n_disconnect (pcm );
1143
+ }
1144
+ if (!pcm -> internal ) {
1145
+ list_for_each_entry (notify , & snd_pcm_notify_list , list )
1146
+ notify -> n_disconnect (pcm );
1144
1147
}
1145
1148
for (cidx = 0 ; cidx < 2 ; cidx ++ ) {
1146
1149
snd_unregister_device (& pcm -> streams [cidx ].dev );
0 commit comments