public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] xfs_repair: fix record_allocation list manipulation
@ 2009-09-18  3:38 Eric Sandeen
  2009-09-18  4:54 ` Eric Sandeen
  2009-09-19 14:42 ` [PATCH V2] xfs_repair: fix record_allocation list manipulation Eric Sandeen
  0 siblings, 2 replies; 8+ messages in thread
From: Eric Sandeen @ 2009-09-18  3:38 UTC (permalink / raw)
  To: xfs-oss

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

^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2009-09-25 14:40 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-09-18  3:38 [PATCH] xfs_repair: fix record_allocation list manipulation Eric Sandeen
2009-09-18  4:54 ` 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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox