All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Sandeen <sandeen@sandeen.net>
To: xfs-oss <xfs@oss.sgi.com>
Subject: [PATCH] xfs_repair: fix record_allocation list manipulation
Date: Thu, 17 Sep 2009 22:38:52 -0500	[thread overview]
Message-ID: <4AB300CC.5020707@sandeen.net> (raw)

clang found this one too as a "Dead assignment"

Unless my pointer-fu is totally messed up, this function
was never actually updating the list head.

This would mean that the later free_allocations() calls in
incore_ext_teardown() and free_rt_dup_extent_tree() don't
actually free more than one item, and therefore leak memory.

Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
---

clang record:
http://sandeen.net/clang/xfsprogs/2009-09-09-1/report-1Jnl15.html#EndPath

diff --git a/repair/incore.c b/repair/incore.c
index 84626c9..77f4630 100644
--- a/repair/incore.c
+++ b/repair/incore.c
@@ -33,7 +33,7 @@ void
 record_allocation(ba_rec_t *addr, ba_rec_t *list)
 {
 	addr->next = list;
-	list = addr;
+	*list = addr;
 
 	return;
 }

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

             reply	other threads:[~2009-09-18  3:37 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-18  3:38 Eric Sandeen [this message]
2009-09-18  4:54 ` [PATCH] xfs_repair: fix record_allocation list manipulation Eric Sandeen
2009-09-18  5:19   ` [PATCH] repair: replaced custom block allocation linked lists with list_heads Josef 'Jeff' Sipek
2009-09-25 14:41     ` Eric Sandeen
2009-09-19 14:42 ` [PATCH V2] xfs_repair: fix record_allocation list manipulation Eric Sandeen
2009-09-22 12:02   ` Christoph Hellwig
2009-09-22 15:21     ` Eric Sandeen
2009-09-22 20:04       ` Christoph Hellwig

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=4AB300CC.5020707@sandeen.net \
    --to=sandeen@sandeen.net \
    --cc=xfs@oss.sgi.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.