]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
swap: check p->what for NULL
authorVito Caputo <vcaputo@pengaru.com>
Sat, 21 Mar 2020 05:47:38 +0000 (22:47 -0700)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Mon, 23 Mar 2020 07:30:32 +0000 (08:30 +0100)
Commit 61f9cf4e4c introduced swap_get_parameters(s) but only
checked its return for NULL and not its ->what.

Fixes https://github.com/systemd/systemd/issues/15070

src/core/swap.c

index d4da840c0f4ef1506d3bc0d5eed352d433abc675..c5945371df7c7b8f38b359c40bd8c2b820bd2c3f 100644 (file)
@@ -207,7 +207,7 @@ static int swap_add_device_dependencies(Swap *s) {
                 return 0;
 
         p = swap_get_parameters(s);
-        if (!p)
+        if (!p || !p->what)
                 return 0;
 
         mask = s->from_proc_swaps ? UNIT_DEPENDENCY_PROC_SWAP : UNIT_DEPENDENCY_FILE;