summaryrefslogtreecommitdiffstats
path: root/src/core/swap.c
diff options
context:
space:
mode:
authorVito Caputo <vcaputo@pengaru.com>2020-03-21 06:47:38 +0100
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2020-03-23 08:30:32 +0100
commitd4a3494e65946ab78647b5277adcabed0ec43da3 (patch)
tree82f7f2fdbfeb39cbad479ab3eac304abef206b33 /src/core/swap.c
parentman: fix typo in loader.conf(5) (diff)
downloadsystemd-d4a3494e65946ab78647b5277adcabed0ec43da3.tar.xz
systemd-d4a3494e65946ab78647b5277adcabed0ec43da3.zip
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
Diffstat (limited to 'src/core/swap.c')
-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;