From d4a3494e65946ab78647b5277adcabed0ec43da3 Mon Sep 17 00:00:00 2001 From: Vito Caputo Date: Fri, 20 Mar 2020 22:47:38 -0700 Subject: [PATCH] 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 --- src/core/swap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/swap.c b/src/core/swap.c index d4da840c0f4..c5945371df7 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;