Skip to content

Commit 15e1426

Browse files
committed
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>
1 parent 2230c4b commit 15e1426

1 file changed

Lines changed: 6 additions & 5 deletions

File tree

drivers/acpi/numa/hmat.c

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -888,12 +888,13 @@ static void hmat_register_target(struct memory_target *target)
888888
* Register generic port perf numbers. The nid may not be
889889
* initialized and is still NUMA_NO_NODE.
890890
*/
891-
mutex_lock(&target_lock);
892-
if (*(u16 *)target->gen_port_device_handle) {
893-
hmat_update_generic_target(target);
894-
target->registered = true;
891+
scoped_guard(mutex, &target_lock) {
892+
if (*(u16 *)target->gen_port_device_handle) {
893+
hmat_update_generic_target(target);
894+
target->registered = true;
895+
return;
896+
}
895897
}
896-
mutex_unlock(&target_lock);
897898

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

0 commit comments

Comments
 (0)