boot: Given up pxe boot if kernel_addr_r is missing
At present we require this environment variable in order to do any booting. The check for this actually later (the '"malloc fail' message) but there is a possible NULL access before getting to that point. Check it immediately after reading. Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
@@ -682,6 +682,10 @@ static int label_boot(struct pxe_context *ctx, struct pxe_label *label)
|
||||
}
|
||||
|
||||
kernel_addr = env_get("kernel_addr_r");
|
||||
if (!kernel_addr) {
|
||||
printf("No kernel_addr_r available for kernel\n");
|
||||
return 1;
|
||||
}
|
||||
/* for FIT, append the configuration identifier */
|
||||
if (label->config) {
|
||||
int len = strlen(kernel_addr) + strlen(label->config) + 1;
|
||||
|
||||
Reference in New Issue
Block a user