mirror of https://github.com/ARMmbed/mbed-os.git
				
				
				
			Fix Coverity uninitialized pointer field Thread.h
Changed _obj_mem to be initialized with constructor of new thread.pull/11273/head
							parent
							
								
									101ae73b87
								
							
						
					
					
						commit
						6467f56abf
					
				| 
						 | 
				
			
			@ -51,7 +51,8 @@ void Thread::constructor(uint32_t tz_module, osPriority priority,
 | 
			
		|||
    const uint32_t offset = aligned_mem - unaligned_mem;
 | 
			
		||||
    const uint32_t aligned_size = ALIGN_DOWN(stack_size - offset, 8);
 | 
			
		||||
 | 
			
		||||
    _tid = 0;
 | 
			
		||||
    memset(&_obj_mem, 0, sizeof(_obj_mem));
 | 
			
		||||
    _tid = nullptr;
 | 
			
		||||
    _dynamic_stack = (stack_mem == nullptr);
 | 
			
		||||
    _finished = false;
 | 
			
		||||
    memset(&_attr, 0, sizeof(_attr));
 | 
			
		||||
| 
						 | 
				
			
			@ -106,7 +107,6 @@ osStatus Thread::start(mbed::Callback<void()> task)
 | 
			
		|||
        ((uint32_t *)_attr.stack_mem)[i] = osRtxStackMagicWord;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    memset(&_obj_mem, 0, sizeof(_obj_mem));
 | 
			
		||||
    _attr.cb_size = sizeof(_obj_mem);
 | 
			
		||||
    _attr.cb_mem = &_obj_mem;
 | 
			
		||||
    _task = task;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue