mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: "Ulrich Ölmann" <u.oelmann@pengutronix.de>
To: Barebox List <barebox@lists.infradead.org>
Subject: [PATCH 2/3] state: backend_bucket_circular: fix double free()
Date: Mon, 30 Sep 2019 08:41:36 +0200	[thread overview]
Message-ID: <20190930064137.2091-2-u.oelmann@pengutronix.de> (raw)
In-Reply-To: <20190930064137.2091-1-u.oelmann@pengutronix.de>

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

Signed-off-by: Ulrich Ölmann <u.oelmann@pengutronix.de>
---
 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@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  reply	other threads:[~2019-09-30  6:41 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-30  6:41 [PATCH 1/3] state: backend_bucket_circular: harmonize code with dt-utils Ulrich Ölmann
2019-09-30  6:41 ` Ulrich Ölmann [this message]
2019-09-30  6:41 ` [PATCH 3/3] common: state: fix backward compatibility Ulrich Ölmann
2019-09-30 18:41 ` [PATCH 1/3] state: backend_bucket_circular: harmonize code with dt-utils Sascha Hauer

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=20190930064137.2091-2-u.oelmann@pengutronix.de \
    --to=u.oelmann@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    /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