public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Mattijs Korpershoek <mkorpershoek@baylibre.com>
To: Alexey Romanov <avromanov@salutedevices.com>,
	"jpewhacker@gmail.com" <jpewhacker@gmail.com>,
	"sjg@google.com" <sjg@google.com>,
	"semen.protsenko@linaro.org" <semen.protsenko@linaro.org>,
	"igor.opaniuk@gmail.com" <igor.opaniuk@gmail.com>,
	"trini@konsulko.com" <trini@konsulko.com>
Cc: "u-boot@lists.denx.de" <u-boot@lists.denx.de>,
	kernel <kernel@sberdevices.ru>
Subject: Re: [PATCH v2] android_ab: don't ignore ab_control_store return code
Date: Fri, 12 Jan 2024 09:56:08 +0100	[thread overview]
Message-ID: <877ckflyl3.fsf@baylibre.com> (raw)
In-Reply-To: <20240109103720.j6vudgbx5fi74pq7@cab-wsm-0029881>

Hi Alexey,

On Tue, Jan 09, 2024 at 10:37, Alexey Romanov <avromanov@salutedevices.com> wrote:

> + Tom Rini
>
> Hello! Please, ping

It seems that Igor (the Android AB maintainer) has been busy elsewhere.

I've requested to take over maintainership:
https://lore.kernel.org/all/20240112-maintainers-ab-v1-0-f2a538eab18a@baylibre.com/

If that gets accepted, I will pick up this patch.

Thank you for your patience,

Mattijs

>
> On Mon, Dec 25, 2023 at 01:22:45PM +0300, Alexey Romanov wrote:
>> ab_control_store() can return an error if writing to disk fails.
>> In this case, we have to pass the error code to the caller.
>> 
>> Signed-off-by: Alexey Romanov <avromanov@salutedevices.com>
>> Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
>> ---
>>  boot/android_ab.c | 16 ++++++++++++++--
>>  1 file changed, 14 insertions(+), 2 deletions(-)
>> 
>> diff --git a/boot/android_ab.c b/boot/android_ab.c
>> index 73b55c196c..af3c375e07 100644
>> --- a/boot/android_ab.c
>> +++ b/boot/android_ab.c
>> @@ -337,7 +337,14 @@ int ab_select_slot(struct blk_desc *dev_desc, struct disk_partition *part_info,
>>  
>>  	if (store_needed) {
>>  		abc->crc32_le = ab_control_compute_crc(abc);
>> -		ab_control_store(dev_desc, part_info, abc, 0);
>> +		ret = ab_control_store(dev_desc, part_info, abc, 0);
>> +		if (ret < 0) {
>> +#if ANDROID_AB_BACKUP_OFFSET
>> +			free(backup_abc);
>> +#endif
>> +			free(abc);
>> +			return ret;
>> +		}
>>  	}
>>  
>>  #if ANDROID_AB_BACKUP_OFFSET
>> @@ -346,8 +353,13 @@ int ab_select_slot(struct blk_desc *dev_desc, struct disk_partition *part_info,
>>  	 * to the backup offset
>>  	 */
>>  	if (memcmp(backup_abc, abc, sizeof(*abc)) != 0) {
>> -		ab_control_store(dev_desc, part_info, abc,
>> +		ret = ab_control_store(dev_desc, part_info, abc,
>>  				 ANDROID_AB_BACKUP_OFFSET);
>> +		if (ret < 0) {
>> +			free(backup_abc);
>> +			free(abc);
>> +			return ret;
>> +		}
>>  	}
>>  	free(backup_abc);
>>  #endif
>> -- 
>> 2.39.2
>> 
>
> -- 
> Thank you,
> Alexey

  reply	other threads:[~2024-01-12  8:56 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-25 10:22 [PATCH v2] android_ab: don't ignore ab_control_store return code Alexey Romanov
2024-01-09 10:37 ` Alexey Romanov
2024-01-12  8:56   ` Mattijs Korpershoek [this message]
2024-01-12 13:46 ` Tom Rini

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=877ckflyl3.fsf@baylibre.com \
    --to=mkorpershoek@baylibre.com \
    --cc=avromanov@salutedevices.com \
    --cc=igor.opaniuk@gmail.com \
    --cc=jpewhacker@gmail.com \
    --cc=kernel@sberdevices.ru \
    --cc=semen.protsenko@linaro.org \
    --cc=sjg@google.com \
    --cc=trini@konsulko.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