From: Markus Armbruster <armbru@redhat.com>
To: David Gibson <dgibson@redhat.com>
Cc: qemu-devel@nongnu.org
Subject: Memory leak in spapr_machine_init()?
Date: Thu, 18 Jun 2020 08:55:53 +0200 [thread overview]
Message-ID: <874kr8uakm.fsf@dusky.pond.sub.org> (raw)
Either I'm confused (quite possible), or kvmppc_check_papr_resize_hpt()
can leak an Error object on failure. Please walk through the code with
me:
kvmppc_check_papr_resize_hpt(&resize_hpt_err);
This sets @resize_hpt_err on failure.
if (spapr->resize_hpt == SPAPR_RESIZE_HPT_DEFAULT) {
/*
* If the user explicitly requested a mode we should either
* supply it, or fail completely (which we do below). But if
* it's not set explicitly, we reset our mode to something
* that works
*/
if (resize_hpt_err) {
spapr->resize_hpt = SPAPR_RESIZE_HPT_DISABLED;
error_free(resize_hpt_err);
resize_hpt_err = NULL;
Case 1: failure and SPAPR_RESIZE_HPT_DEFAULT; we free @resize_hpt_err.
Good.
} else {
spapr->resize_hpt = smc->resize_hpt_default;
}
}
assert(spapr->resize_hpt != SPAPR_RESIZE_HPT_DEFAULT);
if ((spapr->resize_hpt != SPAPR_RESIZE_HPT_DISABLED) && resize_hpt_err) {
/*
* User requested HPT resize, but this host can't supply it. Bail out
*/
error_report_err(resize_hpt_err);
exit(1);
Case 2: failure and not SPAPR_RESIZE_HPT_DISABLED; fatal. Good.
}
What about case 3: failure and SPAPR_RESIZE_HPT_DISABLED?
Good if we get here via case 1 (we freed @resize_hpt_err).
Else, ???
next reply other threads:[~2020-06-18 6:57 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-06-18 6:55 Markus Armbruster [this message]
2020-06-19 4:13 ` Memory leak in spapr_machine_init()? David Gibson
2020-06-22 8:19 ` Markus Armbruster
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=874kr8uakm.fsf@dusky.pond.sub.org \
--to=armbru@redhat.com \
--cc=dgibson@redhat.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.