|
![](https://seccdn.libravatar.org/avatar/6bc2ebbc861c9a4776b76939247a95d742d150e3feb2878a3b1ffd4d950329db?s=16&d=retro) |
b98348 |
From: Pan Nengyuan <pannengyuan@huawei.com>
|
|
![](https://seccdn.libravatar.org/avatar/6bc2ebbc861c9a4776b76939247a95d742d150e3feb2878a3b1ffd4d950329db?s=16&d=retro) |
b98348 |
Date: Tue, 10 Dec 2019 15:14:37 +0800
|
|
![](https://seccdn.libravatar.org/avatar/4340cf6494ecc1cee077e78c982aaa258e8ca64ea8e9dc9ff84c26ce8a43f8b1?s=16&d=retro) |
1d442b |
Subject: [PATCH] riscv/sifive_u: fix a memory leak in soc_realize()
|
|
![](https://seccdn.libravatar.org/avatar/6bc2ebbc861c9a4776b76939247a95d742d150e3feb2878a3b1ffd4d950329db?s=16&d=retro) |
b98348 |
MIME-Version: 1.0
|
|
![](https://seccdn.libravatar.org/avatar/6bc2ebbc861c9a4776b76939247a95d742d150e3feb2878a3b1ffd4d950329db?s=16&d=retro) |
b98348 |
Content-Type: text/plain; charset=UTF-8
|
|
![](https://seccdn.libravatar.org/avatar/6bc2ebbc861c9a4776b76939247a95d742d150e3feb2878a3b1ffd4d950329db?s=16&d=retro) |
b98348 |
Content-Transfer-Encoding: 8bit
|
|
![](https://seccdn.libravatar.org/avatar/6bc2ebbc861c9a4776b76939247a95d742d150e3feb2878a3b1ffd4d950329db?s=16&d=retro) |
b98348 |
|
|
![](https://seccdn.libravatar.org/avatar/6bc2ebbc861c9a4776b76939247a95d742d150e3feb2878a3b1ffd4d950329db?s=16&d=retro) |
b98348 |
Fix a minor memory leak in riscv_sifive_u_soc_realize()
|
|
![](https://seccdn.libravatar.org/avatar/6bc2ebbc861c9a4776b76939247a95d742d150e3feb2878a3b1ffd4d950329db?s=16&d=retro) |
b98348 |
|
|
![](https://seccdn.libravatar.org/avatar/6bc2ebbc861c9a4776b76939247a95d742d150e3feb2878a3b1ffd4d950329db?s=16&d=retro) |
b98348 |
Reported-by: Euler Robot <euler.robot@huawei.com>
|
|
![](https://seccdn.libravatar.org/avatar/6bc2ebbc861c9a4776b76939247a95d742d150e3feb2878a3b1ffd4d950329db?s=16&d=retro) |
b98348 |
Signed-off-by: Pan Nengyuan <pannengyuan@huawei.com>
|
|
![](https://seccdn.libravatar.org/avatar/6bc2ebbc861c9a4776b76939247a95d742d150e3feb2878a3b1ffd4d950329db?s=16&d=retro) |
b98348 |
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
|
|
![](https://seccdn.libravatar.org/avatar/6bc2ebbc861c9a4776b76939247a95d742d150e3feb2878a3b1ffd4d950329db?s=16&d=retro) |
b98348 |
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
|
|
![](https://seccdn.libravatar.org/avatar/6bc2ebbc861c9a4776b76939247a95d742d150e3feb2878a3b1ffd4d950329db?s=16&d=retro) |
b98348 |
Signed-off-by: Palmer Dabbelt <palmerdabbelt@google.com>
|
|
![](https://seccdn.libravatar.org/avatar/6bc2ebbc861c9a4776b76939247a95d742d150e3feb2878a3b1ffd4d950329db?s=16&d=retro) |
b98348 |
---
|
|
![](https://seccdn.libravatar.org/avatar/6bc2ebbc861c9a4776b76939247a95d742d150e3feb2878a3b1ffd4d950329db?s=16&d=retro) |
b98348 |
hw/riscv/sifive_u.c | 1 +
|
|
![](https://seccdn.libravatar.org/avatar/6bc2ebbc861c9a4776b76939247a95d742d150e3feb2878a3b1ffd4d950329db?s=16&d=retro) |
b98348 |
1 file changed, 1 insertion(+)
|
|
![](https://seccdn.libravatar.org/avatar/6bc2ebbc861c9a4776b76939247a95d742d150e3feb2878a3b1ffd4d950329db?s=16&d=retro) |
b98348 |
|
|
![](https://seccdn.libravatar.org/avatar/6bc2ebbc861c9a4776b76939247a95d742d150e3feb2878a3b1ffd4d950329db?s=16&d=retro) |
b98348 |
diff --git a/hw/riscv/sifive_u.c b/hw/riscv/sifive_u.c
|
|
![](https://seccdn.libravatar.org/avatar/6bc2ebbc861c9a4776b76939247a95d742d150e3feb2878a3b1ffd4d950329db?s=16&d=retro) |
b98348 |
index 0140e95732..0e12b3ccef 100644
|
|
![](https://seccdn.libravatar.org/avatar/6bc2ebbc861c9a4776b76939247a95d742d150e3feb2878a3b1ffd4d950329db?s=16&d=retro) |
b98348 |
--- a/hw/riscv/sifive_u.c
|
|
![](https://seccdn.libravatar.org/avatar/6bc2ebbc861c9a4776b76939247a95d742d150e3feb2878a3b1ffd4d950329db?s=16&d=retro) |
b98348 |
+++ b/hw/riscv/sifive_u.c
|
|
![](https://seccdn.libravatar.org/avatar/6bc2ebbc861c9a4776b76939247a95d742d150e3feb2878a3b1ffd4d950329db?s=16&d=retro) |
b98348 |
@@ -542,6 +542,7 @@ static void riscv_sifive_u_soc_realize(DeviceState *dev, Error **errp)
|
|
![](https://seccdn.libravatar.org/avatar/6bc2ebbc861c9a4776b76939247a95d742d150e3feb2878a3b1ffd4d950329db?s=16&d=retro) |
b98348 |
SIFIVE_U_PLIC_CONTEXT_BASE,
|
|
![](https://seccdn.libravatar.org/avatar/6bc2ebbc861c9a4776b76939247a95d742d150e3feb2878a3b1ffd4d950329db?s=16&d=retro) |
b98348 |
SIFIVE_U_PLIC_CONTEXT_STRIDE,
|
|
![](https://seccdn.libravatar.org/avatar/6bc2ebbc861c9a4776b76939247a95d742d150e3feb2878a3b1ffd4d950329db?s=16&d=retro) |
b98348 |
memmap[SIFIVE_U_PLIC].size);
|
|
![](https://seccdn.libravatar.org/avatar/6bc2ebbc861c9a4776b76939247a95d742d150e3feb2878a3b1ffd4d950329db?s=16&d=retro) |
b98348 |
+ g_free(plic_hart_config);
|
|
![](https://seccdn.libravatar.org/avatar/6bc2ebbc861c9a4776b76939247a95d742d150e3feb2878a3b1ffd4d950329db?s=16&d=retro) |
b98348 |
sifive_uart_create(system_memory, memmap[SIFIVE_U_UART0].base,
|
|
![](https://seccdn.libravatar.org/avatar/6bc2ebbc861c9a4776b76939247a95d742d150e3feb2878a3b1ffd4d950329db?s=16&d=retro) |
b98348 |
serial_hd(0), qdev_get_gpio_in(DEVICE(s->plic), SIFIVE_U_UART0_IRQ));
|
|
![](https://seccdn.libravatar.org/avatar/6bc2ebbc861c9a4776b76939247a95d742d150e3feb2878a3b1ffd4d950329db?s=16&d=retro) |
b98348 |
sifive_uart_create(system_memory, memmap[SIFIVE_U_UART1].base,
|