Re: [PATCH] elf_ops: Don't try to g_mapped_file_unref(NULL)

2020-05-04 Thread Laurent Vivier
Le 23/04/2020 à 22:20, Peter Maydell a écrit : > Calling g_mapped_file_unref() on a NULL pointer is not valid, and > glib will assert if you try it. > > $ qemu-system-arm -M virt -display none -device loader,file=/tmp/bad.elf > qemu-system-arm: -device loader,file=/tmp/bad.elf: GLib: g_mapped_file

Re: [PATCH] elf_ops: Don't try to g_mapped_file_unref(NULL)

2020-04-24 Thread Stefano Garzarella
On Thu, Apr 23, 2020 at 09:20:11PM +0100, Peter Maydell wrote: > Calling g_mapped_file_unref() on a NULL pointer is not valid, and > glib will assert if you try it. > > $ qemu-system-arm -M virt -display none -device loader,file=/tmp/bad.elf > qemu-system-arm: -device loader,file=/tmp/bad.elf: GLi

Re: [PATCH] elf_ops: Don't try to g_mapped_file_unref(NULL)

2020-04-23 Thread Peter Maydell
On Thu, 23 Apr 2020 at 21:25, Philippe Mathieu-Daudé wrote: > > On 4/23/20 10:20 PM, Peter Maydell wrote: > > This will fix the assertion; for the specific case of the generic > > loader it will then fall back from "guess this is an ELF file" to > > "maybe it's a uImage or a hex file" and eventual

Re: [PATCH] elf_ops: Don't try to g_mapped_file_unref(NULL)

2020-04-23 Thread Philippe Mathieu-Daudé
On 4/23/20 10:20 PM, Peter Maydell wrote: Calling g_mapped_file_unref() on a NULL pointer is not valid, and glib will assert if you try it. $ qemu-system-arm -M virt -display none -device loader,file=/tmp/bad.elf qemu-system-arm: -device loader,file=/tmp/bad.elf: GLib: g_mapped_file_unref: asse

[PATCH] elf_ops: Don't try to g_mapped_file_unref(NULL)

2020-04-23 Thread Peter Maydell
Calling g_mapped_file_unref() on a NULL pointer is not valid, and glib will assert if you try it. $ qemu-system-arm -M virt -display none -device loader,file=/tmp/bad.elf qemu-system-arm: -device loader,file=/tmp/bad.elf: GLib: g_mapped_file_unref: assertion 'file != NULL' failed (One way to pro