From 0acfbd17311d2c1bbaac031ae719296d9df85b55 Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Thu, 5 Sep 2013 17:19:41 +0200 Subject: [PATCH] block: properly handle vlist_add() for label, uuid and device cases --- block.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/block.c b/block.c index d4cf089..c9285d6 100644 --- a/block.c +++ b/block.c @@ -302,7 +302,13 @@ static int swap_add(struct uci_section *s) /* store complete swap path */ if (tb[SWAP_DEVICE]) m->target = blobmsg_get_strdup(tb[SWAP_DEVICE]); - vlist_add(&mounts, &m->node, (m->uuid) ? (m->uuid) : (m->device)); + + if (m->uuid) + vlist_add(&mounts, &m->node, m->uuid); + else if (m->label) + vlist_add(&mounts, &m->node, m->label); + else if (m->device) + vlist_add(&mounts, &m->node, m->device); } return 0; -- 2.25.1