]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
oom: Cleanup of information dump code after kill
authorBenjamin Berg <bberg@redhat.com>
Mon, 7 Feb 2022 16:34:21 +0000 (17:34 +0100)
committerLuca Boccassi <luca.boccassi@gmail.com>
Mon, 7 Feb 2022 21:33:50 +0000 (21:33 +0000)
This is a follow up to 29f4185a9cdc ("oomd: Dump top offenders after a
kill action") to clean up the code a bit for review comments that
happened after the code had been merged already.

src/oom/oomd-util.c

index 4d05f57a6923645c7d22c830cecb049aad565bb7..77718d9c9e3898cee9ab87e0da127a91ad9c1081 100644 (file)
@@ -227,7 +227,7 @@ static int dump_kill_candidates(OomdCGroupContext **sorted, int n, int dump_unti
 
         f = open_memstream_unlocked(&dump, &size);
         if (!f)
-                return -errno;;
+                return -errno;
 
         fprintf(f, "Considered %d cgroups for killing, top candidates were:\n", n);
         for (int i = 0; i < dump_until; i++)
@@ -237,8 +237,6 @@ static int dump_kill_candidates(OomdCGroupContext **sorted, int n, int dump_unti
         if (r < 0)
                 return r;
 
-        f = safe_fclose(f);
-
         return log_dump(LOG_INFO, dump);
 }