qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v2 1/1] module: Move local_err initialization to the loop in


From: Claudio Fontana
Subject: Re: [PATCH v2 1/1] module: Move local_err initialization to the loop in module_load_qom_all()
Date: Mon, 12 Aug 2024 17:51:18 +0200
User-agent: Mozilla Thunderbird

Reviewed-by: Claudio Fontana <cfontana@suse.de>

On 8/12/24 10:57, Alexander Ivanov wrote:
> Move local_err initialization inside the loop in the module_load_qom_all()
> function. This change ensures that the error variable is reset to NULL for
> each iteration of the loop. This prevents triggering assert(*errp == NULL)
> failure in error_setv() when local_err is reused in the loop.
> 
> Note: The local_err variable is freed in error_report_err() so there is no
> any leak.
> 
> Signed-off-by: Alexander Ivanov <alexander.ivanov@virtuozzo.com>
> ---
>  util/module.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/util/module.c b/util/module.c
> index 32e263163c..3eb0f06df1 100644
> --- a/util/module.c
> +++ b/util/module.c
> @@ -354,13 +354,13 @@ int module_load_qom(const char *type, Error **errp)
>  void module_load_qom_all(void)
>  {
>      const QemuModinfo *modinfo;
> -    Error *local_err = NULL;
>  
>      if (module_loaded_qom_all) {
>          return;
>      }
>  
>      for (modinfo = module_info; modinfo->name != NULL; modinfo++) {
> +        Error *local_err = NULL;
>          if (!modinfo->objs) {
>              continue;
>          }




reply via email to

[Prev in Thread] Current Thread [Next in Thread]