diff mbox series

[PATCH-for-6.1?,v2,1/3] hw/core: Add missing return on error

Message ID 20210813112608.1452541-2-philmd@redhat.com
State New
Headers show
Series hw/core: fix error checkig in smp_parse | expand

Commit Message

Philippe Mathieu-Daudé Aug. 13, 2021, 11:26 a.m. UTC
If dies is not supported by this machine's CPU topology, don't
keep processing options and return directly.

Fixes: 0aebebb561c ("machine: reject -smp dies!=1 for non-PC machines")
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
 hw/core/machine.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Paolo Bonzini Aug. 13, 2021, 12:29 p.m. UTC | #1
On 13/08/21 13:26, Philippe Mathieu-Daudé wrote:
> If dies is not supported by this machine's CPU topology, don't
> keep processing options and return directly.
> 
> Fixes: 0aebebb561c ("machine: reject -smp dies!=1 for non-PC machines")
> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
> ---
>   hw/core/machine.c | 1 +
>   1 file changed, 1 insertion(+)
> 
> diff --git a/hw/core/machine.c b/hw/core/machine.c
> index 943974d411c..abaeda589b7 100644
> --- a/hw/core/machine.c
> +++ b/hw/core/machine.c
> @@ -752,6 +752,7 @@ static void smp_parse(MachineState *ms, SMPConfiguration *config, Error **errp)
>   
>       if (config->has_dies && config->dies != 0 && config->dies != 1) {
>           error_setg(errp, "dies not supported by this machine's CPU topology");
> +        return;
>       }
>   
>       /* compute missing values, prefer sockets over cores over threads */
> 

Queued, thanks.

Paolo
diff mbox series

Patch

diff --git a/hw/core/machine.c b/hw/core/machine.c
index 943974d411c..abaeda589b7 100644
--- a/hw/core/machine.c
+++ b/hw/core/machine.c
@@ -752,6 +752,7 @@  static void smp_parse(MachineState *ms, SMPConfiguration *config, Error **errp)
 
     if (config->has_dies && config->dies != 0 && config->dies != 1) {
         error_setg(errp, "dies not supported by this machine's CPU topology");
+        return;
     }
 
     /* compute missing values, prefer sockets over cores over threads */