cmd: avb: free partition buffer upon verify completion
PATCH v2 1/1 cmd: avb: free partition buffer upon verify completion
Doing the same as the unittests for libavb [1].
Allows to run 'avb verify' multiple times which can be useful after a failure to be able to re-flash the partition and try again.
---
Hi,
Changelog v2:
- use avb_slot_verity_data_free as suggested by Igor
This was added because of the following scenario:
1- fastboot flash boot boot.img
2- avb verify
-> fails because vbmeta wasn't updated
3- fastboot flash vbmeta vbmeta.img
4- avb verify
-> fails because it can't allocate memory as previous buffer wasn't
freed
Let me know if you have any questions.
Regards,
Gary
--- cmd/avb.c | 3 +++ 1 file changed, 3 insertions(+)
cmd/avb.c +3 -0
@@ -312,6 +312,9 @@ int do_avb_verify_part(cmd_tbl_t *cmdtp, int flag,printf ("Unknown error occurred\n" ); } +if (out_data) +avb_slot_verify_data_free (out_data); +return res; }
Signature · 1 line
2.26.2
PATCH v2 1/1 cmd: avb: free partition buffer upon verify completion
Hi Gary,
Quoted 48 lines · Gary Bisson
Doing the same as the unittests for libavb [1].
Allows to run 'avb verify' multiple times which can be useful after a failure to be able to re-flash the partition and try again.
Signed-off-by Gary Bisson <[email protected]>---
Hi,Changelog v2:
- useavb_slot_verity_data_freeas suggested by IgorThis was added because of the following scenario:
1- fastboot flash boot boot.img
2- avb verify
-> fails because vbmeta wasn't updated
3- fastboot flash vbmeta vbmeta.img
4- avb verify
-> fails because it can't allocate memory as previous buffer wasn't
freedLet me know if you have any questions.
Regards,
Gary--- cmd/avb.c | 3 +++ 1 file changed, 3 insertions(+)cmd/avb.c +3
-1@@ -312,6 +312,9 @@ int do_avb_verify_part(cmd_tbl_t *cmdtp, int flag,printf ("Unknown error occurred\n" ); } +if (out_data) +avb_slot_verify_data_free (out_data); +return res; } --
Quoted 2 lines
2.26.2
Thanks
Signature · 8 lines
Best regards - Freundliche Gr?sse - Meilleures salutations Igor Opaniuk mailto: igor.opaniuk at gmail.com skype: igor.opanyuk +380 (93) 836 40 67 http://ua.linkedin.com/in/iopaniuk
PATCH v2 1/1 cmd: avb: free partition buffer upon verify completion
In reply to Gary BissonQuoted 10 lines · Gary Bisson
Doing the same as the unittests for libavb [1].
Allows to run 'avb verify' multiple times which can be useful after a failure to be able to re-flash the partition and try again.
Signed-off-by Gary Bisson <[email protected]>Reviewed-by Igor Opaniuk <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 659 bytes Desc: not available URL: <https://lists.denx.de/pipermail/u-boot/attachments/20200520/7c2cd102/attachment.sig>