public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] xfs: free bp in xlog_find_zeroed() error path
@ 2013-08-01  1:32 Eric Sandeen
  2013-08-01 14:10 ` Mark Tinguely
  2013-08-13 21:34 ` Ben Myers
  0 siblings, 2 replies; 3+ messages in thread
From: Eric Sandeen @ 2013-08-01  1:32 UTC (permalink / raw)
  To: xfs-oss

xlog_find_zeroed() currently leaks a bp on one error path.

Using the bp_err: target resolves this.

Found by Coverity.

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

p.s. this can be merged to userspace as well.

diff --git a/fs/xfs/xfs_log_recover.c b/fs/xfs/xfs_log_recover.c
index 6fcc910a..2e10742 100644
--- a/fs/xfs/xfs_log_recover.c
+++ b/fs/xfs/xfs_log_recover.c
@@ -1144,7 +1144,8 @@ xlog_find_zeroed(
 		 */
 		xfs_warn(log->l_mp,
 			"Log inconsistent or not a log (last==0, first!=1)");
-		return XFS_ERROR(EINVAL);
+		error = XFS_ERROR(EINVAL);
+		goto bp_err;
 	}
 
 	/* we have a partially zeroed log */

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

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

end of thread, other threads:[~2013-08-13 21:34 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-08-01  1:32 [PATCH] xfs: free bp in xlog_find_zeroed() error path Eric Sandeen
2013-08-01 14:10 ` Mark Tinguely
2013-08-13 21:34 ` Ben Myers

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