[PATCH 2/3] state: backend_bucket_circular: fix double free()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 <kch@xxxxxxx>
| 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 <kch@xxxxxxx>
|     Reviewed-by: Ulrich Ölmann <u.oelmann@xxxxxxxxxxxxxx>
|     Reviewed-by: Uwe Kleine-König <u.kleine-koenig@xxxxxxxxxxxxxx>
|     Signed-off-by: Roland Hieber <rhi@xxxxxxxxxxxxxx>

Signed-off-by: Ulrich Ölmann <u.oelmann@xxxxxxxxxxxxxx>
---
 common/state/backend_bucket_circular.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/common/state/backend_bucket_circular.c b/common/state/backend_bucket_circular.c
index 612fa0cd8a11..735510e0d36b 100644
--- a/common/state/backend_bucket_circular.c
+++ b/common/state/backend_bucket_circular.c
@@ -178,7 +178,6 @@ static int state_mtd_peb_read(struct state_backend_storage_bucket_circular *circ
 	if (ret < 0) {
 		dev_err(circ->dev, "Failed to read circular storage len %d, %d\n",
 			len, ret);
-		free(buf);
 		return ret;
 	}
 
-- 
2.23.0


_______________________________________________
barebox mailing list
barebox@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/barebox




[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux