OSDN Git Service

hw/timer/cadence_ttc: move timer_new from init() into realize() to avoid memleaks
authorPan Nengyuan <pannengyuan@huawei.com>
Thu, 5 Mar 2020 16:09:16 +0000 (16:09 +0000)
committerPeter Maydell <peter.maydell@linaro.org>
Thu, 5 Mar 2020 16:09:16 +0000 (16:09 +0000)
commitf4228077e80cb30811e185d5330d2df778e667b3
tree61c3bad4ccc065aa17d4de4673e1f8a7282a869c
parentefb27a49af974baaad602ed26ef999f567063f12
hw/timer/cadence_ttc: move timer_new from init() into realize() to avoid memleaks

There are some memleaks when we call 'device_list_properties'. This patch move timer_new from init into realize to fix it.

Reported-by: Euler Robot <euler.robot@huawei.com>
Signed-off-by: Pan Nengyuan <pannengyuan@huawei.com>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Message-id: 20200227025055.14341-7-pannengyuan@huawei.com
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
hw/timer/cadence_ttc.c