From: Darrick J. Wong Date: Wed, 8 Apr 2020 13:48:15 +0000 (-0400) Subject: libxfs: don't barf in libxfs_bwrite on a null buffer ops name X-Git-Tag: v5.6.0-rc1~8 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=0a82d75eca54ecb87da5aaf8668195ec3916031e;p=users%2Fhch%2Fxfsprogs.git libxfs: don't barf in libxfs_bwrite on a null buffer ops name Don't crash if we failed to write a buffer that had no buffer verifier. This should be rare in practice, but coverity found a valid bug. Coverity-id: 1460462 Signed-off-by: Darrick J. Wong Reviewed-by: Allison Collins Signed-off-by: Eric Sandeen --- diff --git a/libxfs/rdwr.c b/libxfs/rdwr.c index 3c43a4d0d..8a6902699 100644 --- a/libxfs/rdwr.c +++ b/libxfs/rdwr.c @@ -1028,7 +1028,7 @@ libxfs_bwrite( if (bp->b_error) { fprintf(stderr, _("%s: write failed on %s bno 0x%llx/0x%x, err=%d\n"), - __func__, bp->b_ops->name, + __func__, bp->b_ops ? bp->b_ops->name : "(unknown)", (long long)bp->b_bn, bp->b_bcount, -bp->b_error); } else { bp->b_flags |= LIBXFS_B_UPTODATE;