From: Sascha Hauer <s.hauer@pengutronix.de>
To: Ahmad Fatoum <a.fatoum@pengutronix.de>
Cc: barebox@lists.infradead.org, "Claude Opus 4.6" <noreply@anthropic.com>
Subject: Re: [PATCH 05/12] bootm: android: fix PTR_ERR called after clearing error pointer
Date: Mon, 23 Feb 2026 11:12:31 +0100 [thread overview]
Message-ID: <aZwoD5oRA7A7Gs7K@pengutronix.de> (raw)
In-Reply-To: <20260216084253.3547270-5-a.fatoum@pengutronix.de>
On Mon, Feb 16, 2026 at 09:42:21AM +0100, Ahmad Fatoum wrote:
> Both the kernel and initrd error paths set the pointer to NULL before
> calling PTR_ERR(), which always yields 0 (apparent success) instead of
> the actual error code from aimage_copy_component().
>
> Swap the order so PTR_ERR() captures the error code before the pointer
> is cleared.
Squashed this and the next one into the original commit adding this
file.
Sascha
>
> Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
> Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
> ---
> common/bootm-android-image.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/common/bootm-android-image.c b/common/bootm-android-image.c
> index cb86123659ba..828400fef772 100644
> --- a/common/bootm-android-image.c
> +++ b/common/bootm-android-image.c
> @@ -101,8 +101,8 @@ static int do_bootm_aimage(struct image_data *img_data)
> if (hdr->kernel.size) {
> kernel = aimage_copy_component(fd, ofs, hdr->kernel.size);
> if (IS_ERR(kernel)) {
> - kernel = NULL;
> ret = PTR_ERR(kernel);
> + kernel = NULL;
> goto err_close;
> }
> }
> @@ -112,8 +112,8 @@ static int do_bootm_aimage(struct image_data *img_data)
> if (hdr->ramdisk.size) {
> initrd = aimage_copy_component(fd, ofs, hdr->ramdisk.size);
> if (IS_ERR(initrd)) {
> - initrd = NULL;
> ret = PTR_ERR(initrd);
> + initrd = NULL;
> goto err_close;
> }
> }
> --
> 2.47.3
>
>
>
--
Pengutronix e.K. | |
Steuerwalder Str. 21 | http://www.pengutronix.de/ |
31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
next prev parent reply other threads:[~2026-02-23 10:13 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-16 8:42 [PATCH 01/12] firmware: xilinx-fpga: fix double free in probe error path Ahmad Fatoum
2026-02-16 8:42 ` [PATCH 02/12] driver: fix missing va_end in dev_add_alias " Ahmad Fatoum
2026-02-16 8:42 ` [PATCH 03/12] net: eth: avoid overlapping memcpy in eth_set_ethaddr Ahmad Fatoum
2026-02-16 8:42 ` [PATCH 04/12] pmdomain: fix dereference before NULL check in genpd_get_from_provider Ahmad Fatoum
2026-02-16 8:42 ` [PATCH 05/12] bootm: android: fix PTR_ERR called after clearing error pointer Ahmad Fatoum
2026-02-23 10:12 ` Sascha Hauer [this message]
2026-02-16 8:42 ` [PATCH 06/12] bootm: android: fix double close of fd Ahmad Fatoum
2026-02-16 8:42 ` [PATCH 07/12] net: phy: add NULL check for phy driver in page accessors Ahmad Fatoum
2026-02-16 8:42 ` [PATCH 08/12] open: add missing mode argument to O_CREAT calls Ahmad Fatoum
2026-02-16 8:42 ` [PATCH 09/12] hush: add NULL check for gl_pathv after do_glob_in_argv Ahmad Fatoum
2026-02-16 8:42 ` [PATCH 10/12] i2c: rk3x: fix NULL pointer dereference on repeated NACK Ahmad Fatoum
2026-02-16 8:42 ` [PATCH 11/12] mci: imx-esdhc: remove misleading NULL check for cmd pointer Ahmad Fatoum
2026-02-16 8:42 ` [PATCH 12/12] mci: spi: initialize r1 to fix garbage return value Ahmad Fatoum
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=aZwoD5oRA7A7Gs7K@pengutronix.de \
--to=s.hauer@pengutronix.de \
--cc=a.fatoum@pengutronix.de \
--cc=barebox@lists.infradead.org \
--cc=noreply@anthropic.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox