At present when debugging is off, bootdev_find_in_blk() sometimes fails
to find a valid bootflow, e.g. with virtio. Accessing the 'blk' variable
later in the function seems to correct it.
Move the 'ret' check before the debug statement and set the block device
again aftewards, to work around this.
Signed-off-by: Simon Glass <sjg@chromium.org>
} else {
ret = fs_set_blk_dev_with_part(desc, bflow->part);
bflow->state = BOOTFLOWST_PART;
+ if (ret)
+ return log_msg_ret("fs", ret);
/* Use an #ifdef due to info.sys_ind */
#ifdef CONFIG_DOS_PARTITION
blk->name, bflow->part, info.sys_ind,
ret ? -1 : fs_get_type());
#endif
- if (ret)
- return log_msg_ret("fs", ret);
+ bflow->blk = blk;
bflow->state = BOOTFLOWST_FS;
}