summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeremy Kerr <jk@ozlabs.org>2013-10-01 11:03:48 +0800
committerJeremy Kerr <jk@ozlabs.org>2013-10-01 12:51:59 +0800
commitbd6e384a0ba2c1464d9270baf829fea932b88224 (patch)
treee0c9fee88eb1214c533c777faa23c4ce0b54103b
parentb201464a18c990ea6df0f2878e532618d4936c53 (diff)
downloadtalos-petitboot-bd6e384a0ba2c1464d9270baf829fea932b88224.tar.gz
talos-petitboot-bd6e384a0ba2c1464d9270baf829fea932b88224.zip
discover: Don't continue discovery if mount fails
Check the return value from mount_device and abort the discover on failure. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
-rw-r--r--discover/device-handler.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/discover/device-handler.c b/discover/device-handler.c
index cd9c413..8b4046e 100644
--- a/discover/device-handler.c
+++ b/discover/device-handler.c
@@ -586,13 +586,16 @@ int device_handler_discover(struct device_handler *handler,
struct discover_device *dev, enum conf_method method)
{
struct discover_context *ctx;
+ int rc;
process_boot_option_queue(handler);
/* create our context */
ctx = device_handler_discover_context_create(handler, dev);
- mount_device(dev);
+ rc = mount_device(dev);
+ if (rc)
+ goto out;
/* run the parsers. This will populate the ctx's boot_option list. */
iterate_parsers(ctx, method);
@@ -600,6 +603,7 @@ int device_handler_discover(struct device_handler *handler,
/* add discovered stuff to the handler */
device_handler_discover_context_commit(handler, ctx);
+out:
talloc_free(ctx);
return 0;
OpenPOWER on IntegriCloud