diff mbox

[for-2.3] hw/arm/vexpress: Don't double-free flash filename

Message ID 1427968334-14527-1-git-send-email-peter.maydell@linaro.org
State New
Headers show

Commit Message

Peter Maydell April 2, 2015, 9:52 a.m. UTC
Commits 6e05a12f8f7f and db25a1581 both attempt to fix the
same "failed to free memory containing flash filename" bug,
with the effect that when they were both applied we ended
up freeing the memory twice. Delete the spurious extra free.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
Shannon's patch fixes the virt.c board; I checked the other
boards touched by 6e05a12f8f7f and they don't have the problem
(either due to no conflicting patch or because the g_free()
calls were in the same place and the merge combined them.)

 hw/arm/vexpress.c | 1 -
 1 file changed, 1 deletion(-)

Comments

Stefan Weil April 2, 2015, 10:37 a.m. UTC | #1
Am 02.04.2015 um 11:52 schrieb Peter Maydell:
> Commits 6e05a12f8f7f and db25a1581 both attempt to fix the
> same "failed to free memory containing flash filename" bug,
> with the effect that when they were both applied we ended
> up freeing the memory twice. Delete the spurious extra free.
>
> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
> ---
> Shannon's patch fixes the virt.c board; I checked the other
> boards touched by 6e05a12f8f7f and they don't have the problem
> (either due to no conflicting patch or because the g_free()
> calls were in the same place and the merge combined them.)
>
>  hw/arm/vexpress.c | 1 -
>  1 file changed, 1 deletion(-)
>
> diff --git a/hw/arm/vexpress.c b/hw/arm/vexpress.c
> index dd04527..54dd967 100644
> --- a/hw/arm/vexpress.c
> +++ b/hw/arm/vexpress.c
> @@ -583,7 +583,6 @@ static void vexpress_common_init(MachineState *machine)
>              error_report("Could not load ROM image '%s'", bios_name);
>              exit(1);
>          }
> -        g_free(fn);
>      }
>  
>      /* Motherboard peripherals: the wiring is the same but the

Signed-off-by: Stefan Weil <sw@weilnetz.de>
Peter Maydell April 2, 2015, 10:39 a.m. UTC | #2
On 2 April 2015 at 11:37, Stefan Weil <sw@weilnetz.de> wrote:
> Am 02.04.2015 um 11:52 schrieb Peter Maydell:
>> Commits 6e05a12f8f7f and db25a1581 both attempt to fix the
>> same "failed to free memory containing flash filename" bug,
>> with the effect that when they were both applied we ended
>> up freeing the memory twice. Delete the spurious extra free.
>>
>> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
>> ---
>> Shannon's patch fixes the virt.c board; I checked the other
>> boards touched by 6e05a12f8f7f and they don't have the problem
>> (either due to no conflicting patch or because the g_free()
>> calls were in the same place and the merge combined them.)
>>
>>  hw/arm/vexpress.c | 1 -
>>  1 file changed, 1 deletion(-)
>>
>> diff --git a/hw/arm/vexpress.c b/hw/arm/vexpress.c
>> index dd04527..54dd967 100644
>> --- a/hw/arm/vexpress.c
>> +++ b/hw/arm/vexpress.c
>> @@ -583,7 +583,6 @@ static void vexpress_common_init(MachineState *machine)
>>              error_report("Could not load ROM image '%s'", bios_name);
>>              exit(1);
>>          }
>> -        g_free(fn);
>>      }
>>
>>      /* Motherboard peripherals: the wiring is the same but the
>
> Signed-off-by: Stefan Weil <sw@weilnetz.de>

Did you mean reviewed-by ?

-- PMM
Gonglei (Arei) April 2, 2015, 11:14 a.m. UTC | #3
On 2015/4/2 17:52, Peter Maydell wrote:
> Commits 6e05a12f8f7f and db25a1581 both attempt to fix the
> same "failed to free memory containing flash filename" bug,
> with the effect that when they were both applied we ended
> up freeing the memory twice. Delete the spurious extra free.
> 
> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
> ---
> Shannon's patch fixes the virt.c board; I checked the other
> boards touched by 6e05a12f8f7f and they don't have the problem
> (either due to no conflicting patch or because the g_free()
> calls were in the same place and the merge combined them.)
> 
>  hw/arm/vexpress.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/hw/arm/vexpress.c b/hw/arm/vexpress.c
> index dd04527..54dd967 100644
> --- a/hw/arm/vexpress.c
> +++ b/hw/arm/vexpress.c
> @@ -583,7 +583,6 @@ static void vexpress_common_init(MachineState *machine)
>              error_report("Could not load ROM image '%s'", bios_name);
>              exit(1);
>          }
> -        g_free(fn);
>      }
>  
>      /* Motherboard peripherals: the wiring is the same but the
> 

Reviewed-by: Gonglei <arei.gonglei@huawei.com>
Peter Maydell April 2, 2015, 11:49 a.m. UTC | #4
On 2 April 2015 at 10:52, Peter Maydell <peter.maydell@linaro.org> wrote:
> Commits 6e05a12f8f7f and db25a1581 both attempt to fix the
> same "failed to free memory containing flash filename" bug,
> with the effect that when they were both applied we ended
> up freeing the memory twice. Delete the spurious extra free.
>
> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
> ---
> Shannon's patch fixes the virt.c board; I checked the other
> boards touched by 6e05a12f8f7f and they don't have the problem
> (either due to no conflicting patch or because the g_free()
> calls were in the same place and the merge combined them.)
>
>  hw/arm/vexpress.c | 1 -
>  1 file changed, 1 deletion(-)

Applied to master, thanks.

-- PMM
diff mbox

Patch

diff --git a/hw/arm/vexpress.c b/hw/arm/vexpress.c
index dd04527..54dd967 100644
--- a/hw/arm/vexpress.c
+++ b/hw/arm/vexpress.c
@@ -583,7 +583,6 @@  static void vexpress_common_init(MachineState *machine)
             error_report("Could not load ROM image '%s'", bios_name);
             exit(1);
         }
-        g_free(fn);
     }
 
     /* Motherboard peripherals: the wiring is the same but the