Skip to contentSkip to conversation

xfs:free bp in xlog_find_tail() 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_tail() error path

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.

---

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

fs/xfs/xfs_log_recover.c +1 -0
index 2e10742..05c9fab 100644
@@ -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);
 	}

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

Reviewed-by on v1 1/1
#1 lore raw
Quoted 11 lines · Eric Sandeen

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.

---

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

Looks good.

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