mirror of
				https://github.com/alsa-project/alsa-lib.git
				synced 2025-11-03 09:01:52 -05:00 
			
		
		
		
	ucm: Fix uninitialized err in snd_use_case_set()
The compiler warns like: main.c:1664:9: warning: 'err' may be used uninitialized in this function [-Wmaybe-uninitialized] and actually there are slight code paths that slip. This patch adds the proper initializations to 0 to return the success code in these code paths. Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit is contained in:
		
							parent
							
								
									b779f6f432
								
							
						
					
					
						commit
						72c8b07b2a
					
				
					 1 changed files with 2 additions and 2 deletions
				
			
		| 
						 | 
					@ -1443,7 +1443,7 @@ static int set_verb_user(snd_use_case_mgr_t *uc_mgr,
 | 
				
			||||||
                         const char *verb_name)
 | 
					                         const char *verb_name)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
        struct use_case_verb *verb;
 | 
					        struct use_case_verb *verb;
 | 
				
			||||||
        int err;
 | 
					        int err = 0;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        if (uc_mgr->active_verb &&
 | 
					        if (uc_mgr->active_verb &&
 | 
				
			||||||
            strcmp(uc_mgr->active_verb->name, verb_name) == 0)
 | 
					            strcmp(uc_mgr->active_verb->name, verb_name) == 0)
 | 
				
			||||||
| 
						 | 
					@ -1625,7 +1625,7 @@ int snd_use_case_set(snd_use_case_mgr_t *uc_mgr,
 | 
				
			||||||
                     const char *value)
 | 
					                     const char *value)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	char *str, *str1;
 | 
						char *str, *str1;
 | 
				
			||||||
	int err;
 | 
						int err = 0;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	pthread_mutex_lock(&uc_mgr->mutex);
 | 
						pthread_mutex_lock(&uc_mgr->mutex);
 | 
				
			||||||
	if (strcmp(identifier, "_verb") == 0)
 | 
						if (strcmp(identifier, "_verb") == 0)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue