Commit 15e14267 authored by Dave Jiang's avatar Dave Jiang
Browse files

acpi/hmat: Return when generic target is updated



With the current code flow, once the generic target is updated
target->registered is set and the remaining code is skipped.
So return immediately instead of going through the checks and
then skip.

Reviewed-by: default avatarJonathan Cameron <jonathan.cameron@huawei.com>
Link: https://patch.msgid.link/20251105235115.85062-2-dave.jiang@intel.com


Signed-off-by: default avatarDave Jiang <dave.jiang@intel.com>
parent 2230c4bd
Loading
Loading
Loading
Loading
+6 −5
Original line number Diff line number Diff line
@@ -888,12 +888,13 @@ static void hmat_register_target(struct memory_target *target)
	 * Register generic port perf numbers. The nid may not be
	 * initialized and is still NUMA_NO_NODE.
	 */
	mutex_lock(&target_lock);
	scoped_guard(mutex, &target_lock) {
		if (*(u16 *)target->gen_port_device_handle) {
			hmat_update_generic_target(target);
			target->registered = true;
			return;
		}
	}
	mutex_unlock(&target_lock);

	/*
	 * Skip offline nodes. This can happen when memory