mirror of
				https://github.com/alsa-project/alsa-lib.git
				synced 2025-11-03 09:01:52 -05:00 
			
		
		
		
	ucm: add missing uc_mgr_card_close() call to snd_use_case_mgr_open()
Handle the error path correctly. Signed-off-by: Jaroslav Kysela <perex@perex.cz>
This commit is contained in:
		
							parent
							
								
									02b234a39c
								
							
						
					
					
						commit
						447a676ee5
					
				
					 1 changed files with 5 additions and 2 deletions
				
			
		| 
						 | 
					@ -1306,8 +1306,10 @@ int snd_use_case_mgr_open(snd_use_case_mgr_t **uc_mgr,
 | 
				
			||||||
	pthread_mutex_init(&mgr->mutex, NULL);
 | 
						pthread_mutex_init(&mgr->mutex, NULL);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	err = uc_mgr_card_open(mgr);
 | 
						err = uc_mgr_card_open(mgr);
 | 
				
			||||||
	if (err < 0)
 | 
						if (err < 0) {
 | 
				
			||||||
		goto _err;
 | 
							uc_mgr_free(mgr);
 | 
				
			||||||
 | 
							return err;
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	err = snd_config_top(&mgr->local_config);
 | 
						err = snd_config_top(&mgr->local_config);
 | 
				
			||||||
	if (err < 0)
 | 
						if (err < 0)
 | 
				
			||||||
| 
						 | 
					@ -1337,6 +1339,7 @@ int snd_use_case_mgr_open(snd_use_case_mgr_t **uc_mgr,
 | 
				
			||||||
	return 0;
 | 
						return 0;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
_err:
 | 
					_err:
 | 
				
			||||||
 | 
						uc_mgr_card_close(mgr);
 | 
				
			||||||
	uc_mgr_free(mgr);
 | 
						uc_mgr_free(mgr);
 | 
				
			||||||
	return err;
 | 
						return err;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue