提交 90e2c1c2 编写于 作者: D Dave Chinner 提交者: Darrick J. Wong

xfs: perag may be null in xfs_imap()

Dan Carpenter's static checker reported:

The patch 7b13c515: "xfs: use perag for ialloc btree cursors"
from Jun 2, 2021, leads to the following Smatch complaint:

    fs/xfs/libxfs/xfs_ialloc.c:2403 xfs_imap()
    error: we previously assumed 'pag' could be null (see line 2294)

And it's right. Fix it.

Fixes: 7b13c515 ("xfs: use perag for ialloc btree cursors")
Reported-by: NDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: NDave Chinner <dchinner@redhat.com>
Reviewed-by: NDarrick J. Wong <djwong@kernel.org>
Signed-off-by: NDarrick J. Wong <djwong@kernel.org>
Reviewed-by: NAllison Henderson <allison.henderson@oracle.com>
上级 d1015e2e
...@@ -2398,7 +2398,8 @@ xfs_imap( ...@@ -2398,7 +2398,8 @@ xfs_imap(
} }
error = 0; error = 0;
out_drop: out_drop:
xfs_perag_put(pag); if (pag)
xfs_perag_put(pag);
return error; return error;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册