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: Jonathan Cameron <jonathan.cameron@huawei.com>
Link: https://patch.msgid.link/20251105235115.85062-2-dave.jiang@intel.com
Signed-off-by: Dave Jiang <dave.jiang@intel.com>
This commit is contained in:
Dave Jiang 2025-11-05 16:51:14 -07:00
parent 2230c4bdc4
commit 15e1426788
1 changed files with 6 additions and 5 deletions

View File

@ -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