mirror of
				https://github.com/alsa-project/alsa-lib.git
				synced 2025-11-03 09:01:52 -05:00 
			
		
		
		
	pcm_plug: Clear plugins on all error conditions
Otherwise, they will linger after the error is returned (but pcm->setup == 0). Then, if the caller tries to clean up and call snd_pcm_close(), the assertion plug->gen.slave == plug->req_slave will fail. Signed-off-by: Michael Forney <mforney@mforney.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit is contained in:
		
							parent
							
								
									4dfae1adb3
								
							
						
					
					
						commit
						ced8722f7d
					
				
					 1 changed files with 3 additions and 1 deletions
				
			
		| 
						 | 
					@ -652,8 +652,10 @@ static int snd_pcm_plug_insert_plugins(snd_pcm_t *pcm,
 | 
				
			||||||
	       (plug->ttable && !plug->ttable_ok)) {
 | 
						       (plug->ttable && !plug->ttable_ok)) {
 | 
				
			||||||
		snd_pcm_t *new;
 | 
							snd_pcm_t *new;
 | 
				
			||||||
		int err;
 | 
							int err;
 | 
				
			||||||
		if (k >= sizeof(funcs)/sizeof(*funcs))
 | 
							if (k >= sizeof(funcs)/sizeof(*funcs)) {
 | 
				
			||||||
 | 
								snd_pcm_plug_clear(pcm);
 | 
				
			||||||
			return -EINVAL;
 | 
								return -EINVAL;
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
		err = funcs[k](pcm, &new, client, &p);
 | 
							err = funcs[k](pcm, &new, client, &p);
 | 
				
			||||||
		if (err < 0) {
 | 
							if (err < 0) {
 | 
				
			||||||
			snd_pcm_plug_clear(pcm);
 | 
								snd_pcm_plug_clear(pcm);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue