public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Brian Foster <bfoster@redhat.com>
To: Eric Sandeen <sandeen@redhat.com>
Cc: xfs@oss.sgi.com
Subject: Re: [PATCH 1/2] libxfs: don't send null bp to xfs_trans_brelse()
Date: Tue, 17 Jun 2014 11:04:59 -0400	[thread overview]
Message-ID: <20140617150458.GC8905@bfoster.bfoster> (raw)
In-Reply-To: <1402960461-27881-2-git-send-email-sandeen@redhat.com>

On Mon, Jun 16, 2014 at 06:14:20PM -0500, Eric Sandeen wrote:
> In this case, if bp is null, error is set, and we send
> bp to xfs_trans_brelse, which will try to dereference it.
> 
> Test whether we actualy have a buffer before we try to
> free it.
> 
> Same fix as was sent for kernelspace.
> 
> Coverity spotted this.
> 
> Signed-off-by: Eric Sandeen <sandeen@redhat.com>
> ---

Reviewed-by: Brian Foster <bfoster@redhat.com>

>  libxfs/xfs_da_btree.c |    3 ++-
>  1 files changed, 2 insertions(+), 1 deletions(-)
> 
> diff --git a/libxfs/xfs_da_btree.c b/libxfs/xfs_da_btree.c
> index b70454e..b731b54 100644
> --- a/libxfs/xfs_da_btree.c
> +++ b/libxfs/xfs_da_btree.c
> @@ -2582,7 +2582,8 @@ xfs_da_get_buf(
>  				    mapp, nmap, 0);
>  	error = bp ? bp->b_error : XFS_ERROR(EIO);
>  	if (error) {
> -		xfs_trans_brelse(trans, bp);
> +		if (bp)
> +			xfs_trans_brelse(trans, bp);
>  		goto out_free;
>  	}
>  
> -- 
> 1.7.1
> 
> _______________________________________________
> xfs mailing list
> xfs@oss.sgi.com
> http://oss.sgi.com/mailman/listinfo/xfs

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

  reply	other threads:[~2014-06-17 15:05 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-16 23:14 [PATCH 0/2] libxfs: two kernelspace sync-ups Eric Sandeen
2014-06-16 23:14 ` [PATCH 1/2] libxfs: don't send null bp to xfs_trans_brelse() Eric Sandeen
2014-06-17 15:04   ` Brian Foster [this message]
2014-06-16 23:14 ` [PATCH 2/2] libxfs: fix crc field handling in xfs_sb_to/from_disk Eric Sandeen
2014-06-17 15:05   ` Brian Foster

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140617150458.GC8905@bfoster.bfoster \
    --to=bfoster@redhat.com \
    --cc=sandeen@redhat.com \
    --cc=xfs@oss.sgi.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox