File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -174,13 +174,18 @@ int pthread_key_delete(pthread_key_t key)
174174int  pthread_setspecific (pthread_key_t  key , const  void  * value )
175175{
176176	pthread_key_obj  * key_obj ;
177- 	struct  posix_thread  * thread   =   to_posix_thread ( pthread_self ()) ;
177+ 	struct  posix_thread  * thread ;
178178	struct  pthread_key_data  * key_data ;
179179	pthread_thread_data  * thread_spec_data ;
180180	k_spinlock_key_t  key_key ;
181181	sys_snode_t  * node_l ;
182182	int  retval  =  0 ;
183183
184+ 	thread  =  to_posix_thread (pthread_self ());
185+ 	if  (thread  ==  NULL ) {
186+ 		return  EINVAL ;
187+ 	}
188+ 
184189	/* Traverse the list of keys set by the thread, looking for key. 
185190	 * If the key is already in the list, re-assign its value. 
186191	 * Else add the key to the thread's list. 
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments