state: backend_bucket_circular: harmonize code with dt-utils
PATCH 1/3 state: backend_bucket_circular: harmonize code with dt-utils
Comparing barebox' commit [1] with dt-utils' commit [2] it is obvious that adjusting the return value has been forgotten in barebox - fix that. (As the actual code that is changed is removed by the preprocesser when compiling barebox this patch is only of cosmetic nature to keep both code bases in sync).
[1] 9d6d91931afb ("state: Remove -EUCLEAN check from userspace tool")
[2] 791a2404116d ("state: Remove -EUCLEAN check from userspace tool")
--- common/state/backend_bucket_circular.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
common/state/backend_bucket_circular.c +2 -1
@@ -179,9 +179,10 @@ static int state_mtd_peb_read(struct state_backend_storage_bucket_circular *circdev_err (circ->dev,"Failed to read circular storage len %d, %d\n" , len, ret);free (buf); +return ret; } -return ret; +return 0 ; } static int state_mtd_peb_write(struct state_backend_storage_bucket_circular *circ,
Signature · 7 lines
2.23.0 _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
PATCH 2/3 state: backend_bucket_circular: fix double free()
This ports the following dt-utils commit (as the actual code that is changed is removed by the preprocesser when compiling barebox this patch is only of cosmetic nature to keep both code bases in sync):
| commit 634317cc91202304c1477a6d738d7c7691b80419 | Author: Kim Christensen <[email protected]> | Date: Wed Sep 18 16:48:23 2019 +0200 | | state: backend_bucket_circular: fix double free() | | The function state_mtd_peb_read() is only a user of buf and not its owner, | hence it may not deallocate it. | | Signed-off-by: Kim Christensen <[email protected]> | Reviewed-by: Ulrich Ölmann <[email protected]> | Reviewed-by: Uwe Kleine-König <[email protected]> | Signed-off-by: Roland Hieber <[email protected]>
--- common/state/backend_bucket_circular.c | 1 - 1 file changed, 1 deletion(-)
common/state/backend_bucket_circular.c +0 -1
@@ -178,7 +178,6 @@ static int state_mtd_peb_read(struct state_backend_storage_bucket_circular *circif (ret <0 ) {dev_err (circ->dev,"Failed to read circular storage len %d, %d\n" , len, ret); -free (buf);return ret; }
Signature · 7 lines
2.23.0 _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
PATCH 3/3 common: state: fix backward compatibility
In reply to Ulrich ÖlmannThis reverts [1] as it annihilated its counterpart of commit [2].
[1] 5033b4f58f71 ("common: state: harmonize code with dt-utils")
[2] 480cde1b2283 ("state: keep backward compatibility")
--- common/state/backend_bucket_direct.c | 3 --- 1 file changed, 3 deletions(-)
common/state/backend_bucket_direct.c +0 -3
@@ -115,9 +115,6 @@ static int state_backend_bucket_direct_write(struct state_backend_storage_bucketint ret;struct state_backend_storage_bucket_direct_meta meta; -if (len > direct->max_size -sizeof (meta)) -return -E2BIG ; -if (lseek (direct->fd, direct->offset,SEEK_SET ) != direct->offset) {dev_err (direct->dev,"Failed to seek file, %d\n" , -errno);return -errno;
Signature · 7 lines
2.23.0 _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
Sascha Hauer
AppliedQuoted 6 lines · Ulrich Ölmann
Comparing barebox' commit [1] with dt-utils' commit [2] it is obvious that adjusting the return value has been forgotten in barebox - fix that. (As the actual code that is changed is removed by the preprocesser when compiling barebox this patch is only of cosmetic nature to keep both code bases in sync).
Quoted 7 lines
[1]
9d6d91931afb("state: Remove-EUCLEANcheck from userspace tool")
[2]791a2404116d("state: Remove-EUCLEANcheck from userspace tool")Signed-off-by Ulrich Ölmann <[email protected]>--- common/state/backend_bucket_circular.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
Applied, thanks
Sascha
Signature · 9 lines
Pengutronix e.K. | | Industrial Linux Solutions | http://www.pengutronix.de/ | Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox