[PATCH-for-6.0?] hw/rx/rx-gdbsim: Do not accept invalid memory size

Philippe Mathieu-Daudé posted 1 patch 3 years ago
Test checkpatch passed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20210407223056.1870497-1-f4bug@amsat.org
hw/rx/rx-gdbsim.c | 1 +
1 file changed, 1 insertion(+)
[PATCH-for-6.0?] hw/rx/rx-gdbsim: Do not accept invalid memory size
Posted by Philippe Mathieu-Daudé 3 years ago
We check the amount of RAM is enough, warn when it is
not, but if so we neglect to bail out. Fix that by
adding the missing exit() call.

Fixes: bda19d7bb56 ("hw/rx: Add RX GDB simulator")
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
 hw/rx/rx-gdbsim.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/hw/rx/rx-gdbsim.c b/hw/rx/rx-gdbsim.c
index b1d7c2488ff..4e4ececae4b 100644
--- a/hw/rx/rx-gdbsim.c
+++ b/hw/rx/rx-gdbsim.c
@@ -93,6 +93,7 @@ static void rx_gdbsim_init(MachineState *machine)
         char *sz = size_to_str(mc->default_ram_size);
         error_report("Invalid RAM size, should be more than %s", sz);
         g_free(sz);
+        exit(1);
     }
 
     /* Allocate memory space */
-- 
2.26.3

Re: [PATCH-for-6.0?] hw/rx/rx-gdbsim: Do not accept invalid memory size
Posted by Richard Henderson 3 years ago
On 4/7/21 3:30 PM, Philippe Mathieu-Daudé wrote:
> We check the amount of RAM is enough, warn when it is
> not, but if so we neglect to bail out. Fix that by
> adding the missing exit() call.
> 
> Fixes: bda19d7bb56 ("hw/rx: Add RX GDB simulator")
> Signed-off-by: Philippe Mathieu-Daudé<f4bug@amsat.org>
> ---
>   hw/rx/rx-gdbsim.c | 1 +
>   1 file changed, 1 insertion(+)

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>

r~

Re: [PATCH-for-6.0?] hw/rx/rx-gdbsim: Do not accept invalid memory size
Posted by Yoshinori Sato 3 years ago
On Thu, 08 Apr 2021 07:30:56 +0900,
Philippe Mathieu-Daudé wrote:
> 
> We check the amount of RAM is enough, warn when it is
> not, but if so we neglect to bail out. Fix that by
> adding the missing exit() call.
> 
> Fixes: bda19d7bb56 ("hw/rx: Add RX GDB simulator")
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> ---
>  hw/rx/rx-gdbsim.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/hw/rx/rx-gdbsim.c b/hw/rx/rx-gdbsim.c
> index b1d7c2488ff..4e4ececae4b 100644
> --- a/hw/rx/rx-gdbsim.c
> +++ b/hw/rx/rx-gdbsim.c
> @@ -93,6 +93,7 @@ static void rx_gdbsim_init(MachineState *machine)
>          char *sz = size_to_str(mc->default_ram_size);
>          error_report("Invalid RAM size, should be more than %s", sz);
>          g_free(sz);
> +        exit(1);
>      }
>  
>      /* Allocate memory space */
> -- 
> 2.26.3
> 

Reviewed-by: Yoshinori Sato <ysato@users.sourceforge.jp>

-- 
Yoshinori Sato

Re: [PATCH-for-6.0?] hw/rx/rx-gdbsim: Do not accept invalid memory size
Posted by Philippe Mathieu-Daudé 2 years, 11 months ago
Hi Laurent, could you take this patch via your Trivial tree please?

On 4/8/21 12:30 AM, Philippe Mathieu-Daudé wrote:
> We check the amount of RAM is enough, warn when it is
> not, but if so we neglect to bail out. Fix that by
> adding the missing exit() call.
> 
> Fixes: bda19d7bb56 ("hw/rx: Add RX GDB simulator")
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> ---
>  hw/rx/rx-gdbsim.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/hw/rx/rx-gdbsim.c b/hw/rx/rx-gdbsim.c
> index b1d7c2488ff..4e4ececae4b 100644
> --- a/hw/rx/rx-gdbsim.c
> +++ b/hw/rx/rx-gdbsim.c
> @@ -93,6 +93,7 @@ static void rx_gdbsim_init(MachineState *machine)
>          char *sz = size_to_str(mc->default_ram_size);
>          error_report("Invalid RAM size, should be more than %s", sz);
>          g_free(sz);
> +        exit(1);
>      }
>  
>      /* Allocate memory space */
> 

Re: [PATCH-for-6.0?] hw/rx/rx-gdbsim: Do not accept invalid memory size
Posted by Laurent Vivier 2 years, 11 months ago
Le 02/05/2021 à 18:27, Philippe Mathieu-Daudé a écrit :
> Hi Laurent, could you take this patch via your Trivial tree please?
> 
> On 4/8/21 12:30 AM, Philippe Mathieu-Daudé wrote:
>> We check the amount of RAM is enough, warn when it is
>> not, but if so we neglect to bail out. Fix that by
>> adding the missing exit() call.
>>
>> Fixes: bda19d7bb56 ("hw/rx: Add RX GDB simulator")
>> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
>> ---
>>  hw/rx/rx-gdbsim.c | 1 +
>>  1 file changed, 1 insertion(+)
>>
>> diff --git a/hw/rx/rx-gdbsim.c b/hw/rx/rx-gdbsim.c
>> index b1d7c2488ff..4e4ececae4b 100644
>> --- a/hw/rx/rx-gdbsim.c
>> +++ b/hw/rx/rx-gdbsim.c
>> @@ -93,6 +93,7 @@ static void rx_gdbsim_init(MachineState *machine)
>>          char *sz = size_to_str(mc->default_ram_size);
>>          error_report("Invalid RAM size, should be more than %s", sz);
>>          g_free(sz);
>> +        exit(1);
>>      }
>>  
>>      /* Allocate memory space */
>>
> 

Applied to my trivial-patches branch.

Thanks,
Laurent