Skip to contentSkip to conversation

platform/x86/intel/ifs: Add missing destroy_work_on_stack()

PATCH In review Yuan Can 3 participants 3 messages Nov 5, 2024

Subsystems (2)
lore
Share & tools
lore

Yuan Can

author
#0 lore raw

PATCH 1/1 platform/x86/intel/ifs: Add missing destroy_work_on_stack()

This commit add missed destroy_work_on_stack() operations for local_work.w in scan_chunks_sanity_check().

Fixes 3279decb2c3c ("platform/x86/intel/ifs: Annotate work queue on stack so object debug does not complain")
---
 drivers/platform/x86/intel/ifs/load.c | 1 +
 1 file changed, 1 insertion(+)
drivers/platform/x86/intel/ifs/load.c +1 -0
index de54bd1a5970..2faeb1ffbd92 100644
@@ -347,6 +347,7 @@ static int scan_chunks_sanity_check(struct device *dev)
 		INIT_WORK_ONSTACK(&local_work.w, copy_hashes_authenticate_chunks);
 		schedule_work_on(cpu, &local_work.w);
 		wait_for_completion(&ifs_done);
+		destroy_work_on_stack(&local_work.w);
 		if (ifsd->loading_error) {
 			ret = -EIO;
 			goto out;
Signature · 1 line
2.17.1
maintainer
#1 lore raw
Quoted 2 lines · Yuan Can

This commit add missed destroy_work_on_stack() operations for local_work.w in scan_chunks_sanity_check().

The commit 3279decb2c3c ("platform/x86/intel/ifs: Annotate work queue on stack so object debug does not complain") missed calling destroy_work_on_stack() for ...

Signature · 1 line
 i.
Quoted 19 lines
Fixes 3279decb2c3c ("platform/x86/intel/ifs: Annotate work queue on stack so object debug does not complain")
---
 drivers/platform/x86/intel/ifs/load.c | 1 +
 1 file changed, 1 insertion(+)
drivers/platform/x86/intel/ifs/load.c +1 -0
index de54bd1a5970..2faeb1ffbd92 100644
@@ -347,6 +347,7 @@ static int scan_chunks_sanity_check(struct device *dev)
 		INIT_WORK_ONSTACK(&local_work.w, copy_hashes_authenticate_chunks);
 		schedule_work_on(cpu, &local_work.w);
 		wait_for_completion(&ifs_done);
+		destroy_work_on_stack(&local_work.w);
 		if (ifsd->loading_error) {
 			ret = -EIO;
 			goto out;
Reviewed-by on v1 1/1
#2 lore raw
In reply to Yuan Can
Quoted 3 lines · Yuan Can

This commit add missed destroy_work_on_stack() operations for local_work.w in scan_chunks_sanity_check().

If you were seeing any specific warnings, might be helpful to mention that too in the commit

Quoted 11 lines
Fixes 3279decb2c3c ("platform/x86/intel/ifs: Annotate work queue on stack so object debug does not complain")
---
 drivers/platform/x86/intel/ifs/load.c | 1 +
 1 file changed, 1 insertion(+)
drivers/platform/x86/intel/ifs/load.c +0 -0
index de54bd1a5970..2faeb1ffbd92 100644

drivers/platform/x86/intel/ifs/load.c static int scan_chunks_sanity_check(struct device *dev) · line 353

Quoted 7 lines
drivers/platform/x86/intel/ifs/load.c +1 -0
@@ -347,6 +347,7 @@ static int scan_chunks_sanity_check(struct device *dev)
 		INIT_WORK_ONSTACK(&local_work.w, copy_hashes_authenticate_chunks);
 		schedule_work_on(cpu, &local_work.w);
 		wait_for_completion(&ifs_done);
+		destroy_work_on_stack(&local_work.w);
 		if (ifsd->loading_error) {
 			ret = -EIO;
 			goto out;

The change looks good to me.
(I see other users of INIT_WORK_ONSTACK having a corresponding destroy_xxx())

Thanks
Jithu