mirror of
				https://github.com/alsa-project/alsa-lib.git
				synced 2025-11-03 09:01:52 -05:00 
			
		
		
		
	ucm: avoid zero card instance number
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
This commit is contained in:
		
							parent
							
								
									754c696aef
								
							
						
					
					
						commit
						7d40a76ef5
					
				
					 1 changed files with 3 additions and 0 deletions
				
			
		| 
						 | 
					@ -780,6 +780,9 @@ int uc_mgr_card_open(snd_use_case_mgr_t *uc_mgr)
 | 
				
			||||||
	while (uc_mgr_card_find(ucm_card_assign)) {
 | 
						while (uc_mgr_card_find(ucm_card_assign)) {
 | 
				
			||||||
		ucm_card_assign++;
 | 
							ucm_card_assign++;
 | 
				
			||||||
		ucm_card_assign &= 0xffff;
 | 
							ucm_card_assign &= 0xffff;
 | 
				
			||||||
 | 
							/* avoid zero card instance number */
 | 
				
			||||||
 | 
							if (ucm_card_assign == 0)
 | 
				
			||||||
 | 
								ucm_card_assign++;
 | 
				
			||||||
		if (ucm_card_assign == prev) {
 | 
							if (ucm_card_assign == prev) {
 | 
				
			||||||
			pthread_mutex_unlock(&ucm_cards_mutex);
 | 
								pthread_mutex_unlock(&ucm_cards_mutex);
 | 
				
			||||||
			return -ENOMEM;
 | 
								return -ENOMEM;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue