diff --git a/common/bootm.c b/common/bootm.c index 169000c..36f6c41 100644 --- a/common/bootm.c +++ b/common/bootm.c @@ -562,18 +562,15 @@ data->os_entry = bootm_data->os_entry; ret = read_file_2(data->os_file, &size, &data->os_header, PAGE_SIZE); - if (ret < 0 && ret != -EFBIG) + if (ret < 0 && ret != -EFBIG) { + printf("could not open %s: %s\n", data->os_file, + strerror(-ret)); goto err_out; + } if (size < PAGE_SIZE) goto err_out; os_type = file_detect_type(data->os_header, PAGE_SIZE); - if ((int)os_type < 0) { - printf("could not open %s: %s\n", data->os_file, - strerror(-os_type)); - ret = (int)os_type; - goto err_out; - } if (!data->force && os_type == filetype_unknown) { printf("Unknown OS filetype (try -f)\n");