From: Vishal Chourasia <vishalc@linux.ibm.com>
To: alistair23@gmail.com
Cc: philmd@linaro.org, alistair.francis@wdc.com, qemu-devel@nongnu.org
Subject: Re: [PATCH 2/3] hw/core/loader: Free the image file descriptor on error
Date: Thu, 30 Oct 2025 13:57:16 +0530 [thread overview]
Message-ID: <aQMhZI6IbW0xtQrv@linux.ibm.com> (raw)
In-Reply-To: <20251030015306.2279148-2-alistair.francis@wdc.com>
On Thu, Oct 30, 2025 at 11:53:05AM +1000, alistair23@gmail.com wrote:
> From: Alistair Francis <alistair.francis@wdc.com>
>
> Coverity: CID 1642764
> Fixes: f62226f7dc4 ("hw/core/loader: improve error handling in image loading functions")
> Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
> ---
> hw/core/loader.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/hw/core/loader.c b/hw/core/loader.c
> index 73564a2a46..1598dca03c 100644
> --- a/hw/core/loader.c
> +++ b/hw/core/loader.c
> @@ -86,6 +86,7 @@ int64_t get_image_size(const char *filename, Error **errp)
>
> if (size < 0) {
> error_setg_errno(errp, errno, "lseek failure: %s", filename);
> + close(fd);
> return -1;
> }
Reviewed-by: Vishal Chourasia <vishalc@linux.ibm.com>
>
> --
> 2.51.0
>
>
next prev parent reply other threads:[~2025-10-30 8:29 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-30 1:53 [PATCH 1/3] hw/core/loader: Fixup whitespace for get_image_size() alistair23
2025-10-30 1:53 ` [PATCH 2/3] hw/core/loader: Free the image file descriptor on error alistair23
2025-10-30 8:24 ` Philippe Mathieu-Daudé
2025-10-30 8:27 ` Vishal Chourasia [this message]
2025-10-30 1:53 ` [PATCH 3/3] hw/core/loader: Free the allocated string from size_to_str() alistair23
2025-10-30 8:26 ` Philippe Mathieu-Daudé
2025-10-31 1:10 ` Alistair Francis
2025-10-30 8:23 ` [PATCH 1/3] hw/core/loader: Fixup whitespace for get_image_size() Vishal Chourasia
2025-10-30 8:26 ` Philippe Mathieu-Daudé
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=aQMhZI6IbW0xtQrv@linux.ibm.com \
--to=vishalc@linux.ibm.com \
--cc=alistair.francis@wdc.com \
--cc=alistair23@gmail.com \
--cc=philmd@linaro.org \
--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.