xfs
[Top] [All Lists]

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

To: "'linux-xfs@xxxxxxxxxxx'" <linux-xfs@xxxxxxxxxxx>
Subject: [PATCH] xfs:free bp in xlog_find_tail() error path
From: Eric Sandeen <sandeen@xxxxxxxxxx>
Date: Wed, 31 Jul 2013 20:33:47 -0500
Delivered-to: linux-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_tail() currently leaks a bp on one error path.

There is no error target, so manually free the bp before
returning the error.

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 2e10742..05c9fab 100644
--- a/fs/xfs/xfs_log_recover.c
+++ b/fs/xfs/xfs_log_recover.c
@@ -963,6 +963,7 @@ xlog_find_tail(
        }
        if (!found) {
                xfs_warn(log->l_mp, "%s: couldn't find sync record", __func__);
+               xlog_put_bp(bp);
                ASSERT(0);
                return XFS_ERROR(EIO);
        }

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