From: Eric Sandeen <sandeen@redhat.com>
Date: Thu, 1 Aug 2013 01:32:30 +0000 (-0500)
Subject: xfs: free bp in xlog_find_zeroed() error path
X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=5d0a654974c5cac03ce7c577bcfd6bca0f2b2c5a;p=GitHub%2FLineageOS%2FG12%2Fandroid_kernel_amlogic_linux-4.9.git

xfs: free bp in xlog_find_zeroed() error path

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>
Reviewed-by: Mark Tinguely <tinguely@sgi.com>
Signed-off-by: Ben Myers <bpm@sgi.com>
---

diff --git a/fs/xfs/xfs_log_recover.c b/fs/xfs/xfs_log_recover.c
index 217e7fba734b..46710d94c649 100644
--- a/fs/xfs/xfs_log_recover.c
+++ b/fs/xfs/xfs_log_recover.c
@@ -1145,7 +1145,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 */