loadbsl: retry password if first attempt fails.

This commit is contained in:
Daniel Beer 2013-07-22 11:04:19 +12:00
parent d11785c5d9
commit 0c5751275d
1 changed files with 7 additions and 3 deletions

View File

@ -431,11 +431,15 @@ static device_t loadbsl_open(const struct device_args *args)
return NULL;
}
if (rx_password(dev->trans) < 0) {
printc_dbg("loadbsl: retrying password...\n");
if (rx_password(dev->trans) < 0) {
dev->trans->ops->destroy(dev->trans);
free(dev);
return NULL;
}
}
if (check_and_load(dev->trans) < 0) {
dev->trans->ops->destroy(dev->trans);