mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-31 05:51:53 -06:00
module: Prevent crash by resetting local_err in module_load_qom_all()
Set local_err to NULL after it has been freed in error_report_err(). This
avoids triggering assert(*errp == NULL) failure in error_setv() when
local_err is reused in the loop.
Signed-off-by: Alexander Ivanov <alexander.ivanov@virtuozzo.com>
Reviewed-by: Claudio Fontana <cfontana@suse.de>
Reviewed-by: Denis V. Lunev <den@openvz.org>
Link: https://lore.kernel.org/r/20240809121340.992049-2-alexander.ivanov@virtuozzo.com
[Do the same by moving the declaration instead. - Paolo]
Cc: qemu-stable@nongnu.org
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
(cherry picked from commit 940d802b24
)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
This commit is contained in:
parent
2b5c04d82e
commit
3f2f158299
1 changed files with 1 additions and 1 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue