mailarchive of the pengutronix oss-tools mailing list
 help / color / mirror / Atom feed
From: "Ulrich Ölmann" <u.oelmann@pengutronix.de>
To: Pengutronix Public Open-Source-Development <oss-tools@pengutronix.de>
Cc: "Ulrich Ölmann" <u.oelmann@pengutronix.de>,
	"Kim Christensen" <kch@skov.dk>
Subject: [OSS-Tools] [PATCH dt-utils] state: backend_bucket_circular: fix double free()
Date: Wed, 18 Sep 2019 16:48:23 +0200	[thread overview]
Message-ID: <20190918144823.32534-1-u.oelmann@pengutronix.de> (raw)

From: Kim Christensen <kch@skov.dk>

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>
Acked-by: Ulrich Ölmann <u.oelmann@pengutronix.de>
---
 src/barebox-state/backend_bucket_circular.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/src/barebox-state/backend_bucket_circular.c b/src/barebox-state/backend_bucket_circular.c
index aec17b312cab..f665c3b4539a 100644
--- a/src/barebox-state/backend_bucket_circular.c
+++ b/src/barebox-state/backend_bucket_circular.c
@@ -177,7 +177,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


_______________________________________________
OSS-Tools mailing list
OSS-Tools@pengutronix.de

             reply	other threads:[~2019-09-18 14:48 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-18 14:48 Ulrich Ölmann [this message]
2019-09-18 20:23 ` Uwe Kleine-König
2019-09-19  5:16   ` Ulrich Ölmann
2019-09-23  8:31     ` Roland Hieber

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=20190918144823.32534-1-u.oelmann@pengutronix.de \
    --to=u.oelmann@pengutronix.de \
    --cc=kch@skov.dk \
    --cc=oss-tools@pengutronix.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