summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVito Caputo <vcaputo@pengaru.com>2020-03-20 22:47:38 -0700
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2020-03-26 14:09:09 +0100
commitcd6ff773bd1fccab8a8ee3b3f428014a6c75e659 (patch)
tree0fea6767903907f483a8b3604195b796b92d7c2b
parent9ac1ab16580339f544c26359e999b38735415695 (diff)
downloadsystemd-cd6ff773bd1fccab8a8ee3b3f428014a6c75e659.tar.gz
swap: check p->what for NULL
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 (cherry picked from commit d4a3494e65946ab78647b5277adcabed0ec43da3)
-rw-r--r--src/core/swap.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/core/swap.c b/src/core/swap.c
index d4da840c0f..c5945371df 100644
--- a/src/core/swap.c
+++ b/src/core/swap.c
@@ -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;