public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] xfs:free bp in xlog_find_tail() error path
@ 2013-08-01  1:33 Eric Sandeen
  2013-08-01 14:11 ` Mark Tinguely
  2013-08-13 21:34 ` Ben Myers
  0 siblings, 2 replies; 3+ messages in thread
From: Eric Sandeen @ 2013-08-01  1:33 UTC (permalink / raw)
  To: 'linux-xfs@oss.sgi.com'

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>
---

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);
 	}

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] xfs:free bp in xlog_find_tail() error path
  2013-08-01  1:33 [PATCH] xfs:free bp in xlog_find_tail() error path Eric Sandeen
@ 2013-08-01 14:11 ` Mark Tinguely
  2013-08-13 21:34 ` Ben Myers
  1 sibling, 0 replies; 3+ messages in thread
From: Mark Tinguely @ 2013-08-01 14:11 UTC (permalink / raw)
  To: Eric Sandeen; +Cc: 'linux-xfs@oss.sgi.com'

On 07/31/13 20:33, Eric Sandeen wrote:
> 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>
> ---
>
> p.s. this can be merged to userspace as well.

Looks good.

Reviewed-by: Mark Tinguely <tinguely@sgi.com>

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] xfs:free bp in xlog_find_tail() error path
  2013-08-01  1:33 [PATCH] xfs:free bp in xlog_find_tail() error path Eric Sandeen
  2013-08-01 14:11 ` Mark Tinguely
@ 2013-08-13 21:34 ` Ben Myers
  1 sibling, 0 replies; 3+ messages in thread
From: Ben Myers @ 2013-08-13 21:34 UTC (permalink / raw)
  To: Eric Sandeen; +Cc: 'linux-xfs@oss.sgi.com'

On Wed, Jul 31, 2013 at 08:33:47PM -0500, Eric Sandeen wrote:
> 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>

Applied.

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-08-13 21:34 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-08-01  1:33 [PATCH] xfs:free bp in xlog_find_tail() error path Eric Sandeen
2013-08-01 14:11 ` Mark Tinguely
2013-08-13 21:34 ` Ben Myers

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox