From: Mattijs Korpershoek <mkorpershoek@baylibre.com>
To: Sean Anderson <sean.anderson@seco.com>, u-boot@lists.denx.de
Cc: qianfanguijin@163.com, Dan Carpenter <dan.carpenter@linaro.org>,
Sean Anderson <sean.anderson@seco.com>
Subject: Re: [PATCH] lib: sparse: Fix error checking for write_sparse_chunk_raw
Date: Fri, 02 Feb 2024 10:11:39 +0100 [thread overview]
Message-ID: <87fryb44dw.fsf@baylibre.com> (raw)
In-Reply-To: <20240201181851.221701-1-sean.anderson@seco.com>
Hi Sean,
Thank you for the patch.
On Thu, Feb 01, 2024 at 13:18, Sean Anderson <sean.anderson@seco.com> wrote:
> The return value of write_sparse_chunk_raw is unsigned, so the existing
> check has no effect. Use IS_ERR_VALUE to detect error instead, which is
> what write_sparse_chunk_raw does itself.
>
> Fixes: 62649165cb0 ("lib: sparse: Make CHUNK_TYPE_RAW buffer aligned")
> Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
> Link: https://lore.kernel.org/u-boot/1b323ec3-59b0-490b-a2f0-fd961dafcf49@moroto.mountain/
> Signed-off-by: Sean Anderson <sean.anderson@seco.com>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
> ---
>
> lib/image-sparse.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/lib/image-sparse.c b/lib/image-sparse.c
> index f8289064692..09225692e9b 100644
> --- a/lib/image-sparse.c
> +++ b/lib/image-sparse.c
> @@ -211,7 +211,7 @@ int write_sparse_image(struct sparse_storage *info,
>
> blks = write_sparse_chunk_raw(info, blk, blkcnt,
> data, response);
> - if (blks < 0)
> + if (IS_ERR_VALUE(blks))
> return -1;
>
> blk += blks;
> --
> 2.35.1.1320.gc452695387.dirty
next prev parent reply other threads:[~2024-02-02 9:11 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-01 18:18 [PATCH] lib: sparse: Fix error checking for write_sparse_chunk_raw Sean Anderson
2024-02-01 18:44 ` Michael Nazzareno Trimarchi
2024-02-02 9:11 ` Mattijs Korpershoek [this message]
2024-02-06 12:49 ` Mattijs Korpershoek
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=87fryb44dw.fsf@baylibre.com \
--to=mkorpershoek@baylibre.com \
--cc=dan.carpenter@linaro.org \
--cc=qianfanguijin@163.com \
--cc=sean.anderson@seco.com \
--cc=u-boot@lists.denx.de \
/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