forked from mirrors/linux
		
	ACPICA: Move check for valid Thread ID structure
This change moves the check for a valid Thread ID structure up a few lines to insure that the check is made before the structure is actually used. Signed-off-by: Dan Carpenter <error27@gmail.com> Signed-off-by: Bob Moore <robert.moore@intel.com> Signed-off-by: Lin Ming <ming.m.lin@intel.com> Signed-off-by: Len Brown <len.brown@intel.com>
This commit is contained in:
		
							parent
							
								
									d4085a3ffe
								
							
						
					
					
						commit
						fbc3be2af3
					
				
					 1 changed files with 9 additions and 9 deletions
				
			
		| 
						 | 
				
			
			@ -375,6 +375,15 @@ acpi_ex_release_mutex(union acpi_operand_object *obj_desc,
 | 
			
		|||
		return_ACPI_STATUS(AE_AML_MUTEX_NOT_ACQUIRED);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	/* Must have a valid thread ID */
 | 
			
		||||
 | 
			
		||||
	if (!walk_state->thread) {
 | 
			
		||||
		ACPI_ERROR((AE_INFO,
 | 
			
		||||
			    "Cannot release Mutex [%4.4s], null thread info",
 | 
			
		||||
			    acpi_ut_get_node_name(obj_desc->mutex.node)));
 | 
			
		||||
		return_ACPI_STATUS(AE_AML_INTERNAL);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	/*
 | 
			
		||||
	 * The Mutex is owned, but this thread must be the owner.
 | 
			
		||||
	 * Special case for Global Lock, any thread can release
 | 
			
		||||
| 
						 | 
				
			
			@ -392,15 +401,6 @@ acpi_ex_release_mutex(union acpi_operand_object *obj_desc,
 | 
			
		|||
		return_ACPI_STATUS(AE_AML_NOT_OWNER);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	/* Must have a valid thread ID */
 | 
			
		||||
 | 
			
		||||
	if (!walk_state->thread) {
 | 
			
		||||
		ACPI_ERROR((AE_INFO,
 | 
			
		||||
			    "Cannot release Mutex [%4.4s], null thread info",
 | 
			
		||||
			    acpi_ut_get_node_name(obj_desc->mutex.node)));
 | 
			
		||||
		return_ACPI_STATUS(AE_AML_INTERNAL);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	/*
 | 
			
		||||
	 * The sync level of the mutex must be equal to the current sync level. In
 | 
			
		||||
	 * other words, the current level means that at least one mutex at that
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in a new issue