Skip to content

Commit 82fb9da

Browse files
Haoxiang Ligregkh
authored andcommitted
xfs: fix a resource leak in xfs_alloc_buftarg()
[ Upstream commit 29a7b26 ] In the error path, call fs_put_dax() to drop the DAX device reference. Fixes: 6f643c5 ("xfs: implement ->notify_failure() for XFS") Cc: stable@vger.kernel.org Signed-off-by: Haoxiang Li <lihaoxiang@isrc.iscas.ac.cn> Reviewed-by: Darrick J. Wong <djwong@kernel.org> Signed-off-by: Carlos Maiolino <cem@kernel.org> [ kept `kmem_free(btp)` and `return NULL` instead of `kfree(btp)`/`ERR_PTR(error)` ] Signed-off-by: Sasha Levin <sashal@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent b58baa1 commit 82fb9da

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

fs/xfs/xfs_buf.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2045,6 +2045,7 @@ xfs_alloc_buftarg(
20452045
error_lru:
20462046
list_lru_destroy(&btp->bt_lru);
20472047
error_free:
2048+
fs_put_dax(btp->bt_daxdev, mp);
20482049
kmem_free(btp);
20492050
return NULL;
20502051
}

0 commit comments

Comments
 (0)