[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PULL 24/32] hw/avr: Add support for loading ELF/raw binaries
From: |
Peter Maydell |
Subject: |
Re: [PULL 24/32] hw/avr: Add support for loading ELF/raw binaries |
Date: |
Mon, 13 Jul 2020 13:40:28 +0100 |
On Tue, 7 Jul 2020 at 19:31, Philippe Mathieu-Daudé <f4bug@amsat.org> wrote:
>
> Add avr_load_firmware() function to load firmware in ELF or
> raw binary format.
Hi; Coverity points out a memory leak (CID 1430449) in this function:
> +bool avr_load_firmware(AVRCPU *cpu, MachineState *ms,
> + MemoryRegion *program_mr, const char *firmware)
> +{
> + const char *filename;
> + int bytes_loaded;
> + uint64_t entry;
> + uint32_t e_flags;
> +
> + filename = qemu_find_file(QEMU_FILE_TYPE_BIOS, firmware);
qemu_find_file() allocates and returns memory, but we don't
pass this to any function that takes ownership of it,
and none of the exit paths from the function (either error-exit
or success-exit cases) call g_free() on it.
thanks
-- PMM
- [PULL 14/32] target/avr: Add instruction translation - Bit and Bit-test Instructions, (continued)
- [PULL 14/32] target/avr: Add instruction translation - Bit and Bit-test Instructions, Philippe Mathieu-Daudé, 2020/07/07
- [PULL 17/32] target/avr: Initialize TCG register variables, Philippe Mathieu-Daudé, 2020/07/07
- [PULL 16/32] target/avr: Add instruction translation - CPU main translation function, Philippe Mathieu-Daudé, 2020/07/07
- [PULL 18/32] target/avr: Add support for disassembling via option '-d in_asm', Philippe Mathieu-Daudé, 2020/07/07
- [PULL 19/32] target/avr: Register AVR support with the rest of QEMU, Philippe Mathieu-Daudé, 2020/07/07
- [PULL 20/32] tests/machine-none: Add AVR support, Philippe Mathieu-Daudé, 2020/07/07
- [PULL 21/32] hw/char: avr: Add limited support for USART peripheral, Philippe Mathieu-Daudé, 2020/07/07
- [PULL 22/32] hw/timer: avr: Add limited support for 16-bit timer peripheral, Philippe Mathieu-Daudé, 2020/07/07
- [PULL 26/32] hw/avr: Add limited support for some Arduino boards, Philippe Mathieu-Daudé, 2020/07/07
- [PULL 24/32] hw/avr: Add support for loading ELF/raw binaries, Philippe Mathieu-Daudé, 2020/07/07
- Re: [PULL 24/32] hw/avr: Add support for loading ELF/raw binaries,
Peter Maydell <=
- [PULL 27/32] tests/boot-serial: Test some Arduino boards (AVR based), Philippe Mathieu-Daudé, 2020/07/07
- [PULL 23/32] hw/misc: avr: Add limited support for power reduction device, Philippe Mathieu-Daudé, 2020/07/07
- [PULL 31/32] target/avr/cpu: Fix $PC displayed address, Philippe Mathieu-Daudé, 2020/07/07
- [PULL 32/32] target/avr/disas: Fix store instructions display order, Philippe Mathieu-Daudé, 2020/07/07
- [PULL 28/32] tests/acceptance: Test the Arduino MEGA2560 board, Philippe Mathieu-Daudé, 2020/07/07
- [PULL 29/32] target/avr: Add section into QEMU documentation, Philippe Mathieu-Daudé, 2020/07/07
- [PULL 25/32] hw/avr: Add some ATmega microcontrollers, Philippe Mathieu-Daudé, 2020/07/07
- [PULL 30/32] target/avr/cpu: Drop tlb_flush() in avr_cpu_reset(), Philippe Mathieu-Daudé, 2020/07/07
- Re: [PULL 00/32] AVR port, Peter Maydell, 2020/07/10