kernel: fix put_task if alloc failed.

This commit is contained in:
weishu
2025-11-08 13:37:15 +00:00
committed by ShirkNeko
parent 413e9ab8a9
commit 46b9f5fb4b

View File

@@ -416,11 +416,12 @@ void persistent_allow_list()
kzalloc(sizeof(struct callback_head), GFP_KERNEL); kzalloc(sizeof(struct callback_head), GFP_KERNEL);
if (!cb) { if (!cb) {
pr_err("save_allow_list alloc cb err\b"); pr_err("save_allow_list alloc cb err\b");
return; goto put_task;
} }
cb->func = do_persistent_allow_list; cb->func = do_persistent_allow_list;
task_work_add(tsk, cb, TWA_RESUME); task_work_add(tsk, cb, TWA_RESUME);
put_task:
put_task_struct(tsk); put_task_struct(tsk);
} }