From 646b6f71f49e205d04ebc1f4d96ccb14b7bda1b5 Mon Sep 17 00:00:00 2001 From: weishu Date: Mon, 29 Apr 2024 15:53:12 +0800 Subject: [PATCH] kernel: close fd early --- kernel/throne_tracker.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/kernel/throne_tracker.c b/kernel/throne_tracker.c index b931b60ffca7..665ee3bf2b44 100644 --- a/kernel/throne_tracker.c +++ b/kernel/throne_tracker.c @@ -241,6 +241,7 @@ static void do_update_uid(struct work_struct *work) struct uid_data *data = kzalloc(sizeof(struct uid_data), GFP_ATOMIC); if (!data) { + filp_close(fp, 0); goto out; } @@ -264,6 +265,7 @@ static void do_update_uid(struct work_struct *work) // reset line start line_start = pos; } + filp_close(fp, 0); // now update uid list struct uid_data *np; @@ -299,7 +301,6 @@ static void do_update_uid(struct work_struct *work) list_del(&np->list); kfree(np); } - filp_close(fp, 0); } void track_throne()