Skip to contentSkip to conversation

xfs: free bp in xlog_find_zeroed() error path

PATCH Applied Eric Sandeen 3 participants 3 messages Aug 1, 2013 – Aug 13, 2013 XFS filesystem

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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.

---

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

fs/xfs/xfs_log_recover.c +2 -1
index 6fcc910a..2e10742 100644
@@ -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
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs

#1 lore raw
Quoted 8 lines · Eric Sandeen

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

Using the bp_err: target resolves this.

Found by Coverity.

---

Looks good.

Quoted 1 line

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

or get it in before the 3.12 series gets rebased.

Reviewed-by; Mark Tinguely <[email protected]>

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs