]> git.sur5r.net Git - u-boot/commitdiff
biosemu: Do not free vga_info->BIOSImage when it is 0xc0000
authorBin Meng <bmeng.cn@gmail.com>
Fri, 24 Apr 2015 07:48:05 +0000 (15:48 +0800)
committerSimon Glass <sjg@chromium.org>
Thu, 30 Apr 2015 00:51:49 +0000 (18:51 -0600)
For x86, vga_info->BIOSImage points to 0xc0000 which cannot be freed.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Acked-by: Simon Glass <sjg@chromium.org>
drivers/bios_emulator/atibios.c

index 7ea5fa622472ca38a8256e97cc82c6a2cf883d93..dec6230ad5cd6ca835a4d0f8b8c07906da74fa3f 100644 (file)
@@ -502,7 +502,8 @@ int biosemu_run(pci_dev_t pcidev, uchar *bios_rom, int bios_len,
        */
        if (clean_up) {
                BE_exit();
-               if (vga_info->BIOSImage)
+               if (vga_info->BIOSImage &&
+                   (u32)(vga_info->BIOSImage) != 0xc0000)
                        free(vga_info->BIOSImage);
                free(vga_info);
                vga_info = NULL;