LoadedImage->CommandLine = LoadLinuxAllocateCommandLinePages (\r
EFI_SIZE_TO_PAGES (\r
LoadedImage->CommandLineSize));\r
+ if (LoadedImage->CommandLine == NULL) {\r
+ DEBUG ((DEBUG_ERROR, "Unable to allocate memory for kernel command line!\n"));\r
+ Status = EFI_OUT_OF_RESOURCES;\r
+ goto FreeImage;\r
+ }\r
QemuFwCfgSelectItem (QemuFwCfgItemCommandLineData);\r
QemuFwCfgReadBytes (LoadedImage->CommandLineSize, LoadedImage->CommandLine);\r
}\r
LoadedImage->InitrdData = LoadLinuxAllocateInitrdPages (\r
LoadedImage->SetupBuf,\r
EFI_SIZE_TO_PAGES (LoadedImage->InitrdSize));\r
+ if (LoadedImage->InitrdData == NULL) {\r
+ DEBUG ((DEBUG_ERROR, "Unable to allocate memory for initrd!\n"));\r
+ Status = EFI_OUT_OF_RESOURCES;\r
+ goto FreeImage;\r
+ }\r
DEBUG ((DEBUG_INFO, "Initrd size: 0x%x\n",\r
(UINT32)LoadedImage->InitrdSize));\r
DEBUG ((DEBUG_INFO, "Reading initrd image ..."));\r