xfs:free bp in xlog_find_tail() error path
authorEric Sandeen <sandeen@redhat.com>
Thu, 1 Aug 2013 01:33:47 +0000 (20:33 -0500)
committerBen Myers <bpm@sgi.com>
Tue, 13 Aug 2013 20:49:51 +0000 (15:49 -0500)
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@redhat.com>
Reviewed-by: Mark Tinguely <tinguely@sgi.com>
Signed-off-by: Ben Myers <bpm@sgi.com>
fs/xfs/xfs_log_recover.c

index 46710d94c6499f3c36c62b1abd9b78da229fe550..07bc28466fb245f2325041b88c1c87e3862d3bbe 100644 (file)
@@ -964,6 +964,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);
        }