xfs
[Top] [All Lists]

[PATCH] xfs: free bp in xlog_find_zeroed() error path

To: xfs-oss <xfs@xxxxxxxxxxx>
Subject: [PATCH] xfs: free bp in xlog_find_zeroed() error path
From: Eric Sandeen <sandeen@xxxxxxxxxx>
Date: Wed, 31 Jul 2013 20:32:30 -0500
Delivered-to: xfs@xxxxxxxxxxx
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:17.0) Gecko/20130620 Thunderbird/17.0.7
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@xxxxxxxxxx>
---

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 */

<Prev in Thread] Current Thread [Next in Thread>
  • [PATCH] xfs: free bp in xlog_find_zeroed() error path, Eric Sandeen <=