[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 08/12] migration/colo: Plug memleaks in colo_process_incoming
From: |
Pan Nengyuan |
Subject: |
Re: [PATCH 08/12] migration/colo: Plug memleaks in colo_process_incoming_thread |
Date: |
Thu, 27 Aug 2020 11:06:18 +0800 |
User-agent: |
Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.2.2 |
On 2020/8/26 20:37, Li Qiang wrote:
> Pan Nengyuan <pannengyuan@huawei.com> 于2020年8月14日周五 下午6:52写道:
>>
>> 'local_err' forgot to free in colo_process_incoming_thread error path.
>> Fix that.
>>
>> Reported-by: Euler Robot <euler.robot@huawei.com>
>> Signed-off-by: Pan Nengyuan <pannengyuan@huawei.com>
>> ---
>> Cc: Hailiang Zhang <zhang.zhanghailiang@huawei.com>
>> Cc: Juan Quintela <quintela@redhat.com>
>> Cc: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
>> ---
>> migration/colo.c | 2 ++
>> 1 file changed, 2 insertions(+)
>>
>> diff --git a/migration/colo.c b/migration/colo.c
>> index ea7d1e9d4e..17b5afc6b5 100644
>> --- a/migration/colo.c
>> +++ b/migration/colo.c
>> @@ -870,6 +870,7 @@ void *colo_process_incoming_thread(void *opaque)
>> replication_start_all(REPLICATION_MODE_SECONDARY, &local_err);
>> if (local_err) {
>> qemu_mutex_unlock_iothread();
>> + error_report_err(local_err);
>> goto out;
>> }
>> #else
>> @@ -882,6 +883,7 @@ void *colo_process_incoming_thread(void *opaque)
>> colo_send_message(mis->to_src_file, COLO_MESSAGE_CHECKPOINT_READY,
>> &local_err);
>> if (local_err) {
>> + error_report_err(local_err);
>> goto out;
>> }
>>
>
> Could we arrange 'error_report_err' in 'out' label?
> Like this:
>
> if (local_err) {
> error_report_err(local_err);
> }
Similar to the other place in the same function, I didn't arrange them in 'out'
label:
while (mis->state == MIGRATION_STATUS_COLO) {
colo_wait_handle_message(mis, fb, bioc, &local_err);
if (local_err) {
error_report_err(local_err);
break;
}
But I think it's a good idea to arrange them in 'out' label. I will change it.
Thanks.
>
> Thanks,
> Li Qiang
>
>
>
>> --
>> 2.18.2
>>
>>
> .
>
- Re: [PATCH 03/12] elf2dmp/qemu_elf: Plug memleak in QEMU_Elf_init, (continued)
- [PATCH 05/12] target/i386/sev: Plug memleak in sev_read_file_base64, Pan Nengyuan, 2020/08/14
- [PATCH 01/12] qga/channel-posix: Plug memory leak in ga_channel_write_all(), Pan Nengyuan, 2020/08/14
- [PATCH 06/12] ui/gtk-gl-area: Plug memleak in gd_gl_area_create_context(), Pan Nengyuan, 2020/08/14
- [PATCH 08/12] migration/colo: Plug memleaks in colo_process_incoming_thread, Pan Nengyuan, 2020/08/14
- [PATCH 09/12] blockdev: Fix a memleak in drive_backup_prepare(), Pan Nengyuan, 2020/08/14
- [PATCH 07/12] target/i386/cpu: Fix memleak in x86_cpu_class_check_missing_features, Pan Nengyuan, 2020/08/14
- [PATCH 04/12] elf2dmp/pdb: Plug memleak in pdb_init_from_file, Pan Nengyuan, 2020/08/14
- [PATCH 02/12] hw/vfio/ap: Plug memleak in vfio_ap_get_group(), Pan Nengyuan, 2020/08/14