1
0
mirror of https://github.com/systemd/systemd.git synced 2024-12-23 21:35:11 +03:00

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
This commit is contained in:
Vito Caputo 2020-03-20 22:47:38 -07:00 committed by Zbigniew Jędrzejewski-Szmek
parent 992622c428
commit d4a3494e65

View 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;