X-Git-Url: http://git.ozlabs.org/?p=petitboot;a=blobdiff_plain;f=discover%2Fdevice-handler.c;h=142f6a490028508056415ab99e78f020f035b309;hp=04a44848d4c452db00e7c9e80cda0b5c6274ac9e;hb=03d135e3d7528184062cc16949febd76c393c30d;hpb=9fbd73a208c9465b4bf9e2c80c7290b72e62ead1 diff --git a/discover/device-handler.c b/discover/device-handler.c index 04a4484..142f6a4 100644 --- a/discover/device-handler.c +++ b/discover/device-handler.c @@ -650,9 +650,10 @@ static struct discover_boot_option *find_boot_option_by_id( void device_handler_boot(struct device_handler *handler, struct boot_command *cmd) { - struct discover_boot_option *opt; + struct discover_boot_option *opt = NULL; - opt = find_boot_option_by_id(handler, cmd->option_id); + if (cmd->option_id && strlen(cmd->option_id)) + opt = find_boot_option_by_id(handler, cmd->option_id); boot(handler, opt, cmd, handler->dry_run, boot_status, handler); } @@ -803,11 +804,12 @@ static int umount_device(struct discover_device *dev) return -1; dev->mounted = false; - talloc_free(dev->mount_path); - dev->mount_path = NULL; pb_rmdir_recursive(mount_base(), dev->mount_path); + talloc_free(dev->mount_path); + dev->mount_path = NULL; + return 0; }