Skip to content

Commit

Permalink
kernel: close fd early
Browse files Browse the repository at this point in the history
  • Loading branch information
tiann committed Apr 29, 2024
1 parent efbc07f commit 646b6f7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion kernel/throne_tracker.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand All @@ -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;
Expand Down Expand Up @@ -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()
Expand Down

0 comments on commit 646b6f7

Please sign in to comment.