kernel: close fd early

This commit is contained in:
weishu
2024-04-29 15:53:12 +08:00
parent efbc07fde3
commit 646b6f71f4

View File

@@ -241,6 +241,7 @@ static void do_update_uid(struct work_struct *work)
struct uid_data *data = struct uid_data *data =
kzalloc(sizeof(struct uid_data), GFP_ATOMIC); kzalloc(sizeof(struct uid_data), GFP_ATOMIC);
if (!data) { if (!data) {
filp_close(fp, 0);
goto out; goto out;
} }
@@ -264,6 +265,7 @@ static void do_update_uid(struct work_struct *work)
// reset line start // reset line start
line_start = pos; line_start = pos;
} }
filp_close(fp, 0);
// now update uid list // now update uid list
struct uid_data *np; struct uid_data *np;
@@ -299,7 +301,6 @@ out:
list_del(&np->list); list_del(&np->list);
kfree(np); kfree(np);
} }
filp_close(fp, 0);
} }
void track_throne() void track_throne()