Check the return value from mount_device and abort the discover on
failure.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
struct discover_device *dev, enum conf_method method)
{
struct discover_context *ctx;
struct discover_device *dev, enum conf_method method)
{
struct discover_context *ctx;
process_boot_option_queue(handler);
/* create our context */
ctx = device_handler_discover_context_create(handler, dev);
process_boot_option_queue(handler);
/* create our context */
ctx = device_handler_discover_context_create(handler, 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);
/* run the parsers. This will populate the ctx's boot_option list. */
iterate_parsers(ctx, method);
/* add discovered stuff to the handler */
device_handler_discover_context_commit(handler, ctx);
/* add discovered stuff to the handler */
device_handler_discover_context_commit(handler, ctx);
talloc_free(ctx);
return 0;
talloc_free(ctx);
return 0;