Skip to content

Commit

Permalink
xfs: use kvfree() in xlog_cil_free_logvec()
Browse files Browse the repository at this point in the history
The xfs_log_vec items are allocated by xlog_kvmalloc(), and so need
to be freed with kvfree. This was missed when coverting from the
kmem_free() API.

Fixes: 4929257 ("xfs: convert kmem_free() for kvmalloc users to kvfree()")
Reported-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Tested-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Chandan Babu R <chandanbabu@kernel.org>
  • Loading branch information
Dave Chinner authored and Chandan Babu R committed Feb 28, 2024
1 parent 3aca067 commit b8c0d6f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions fs/xfs/xfs_log_cil.c
Original file line number Diff line number Diff line change
Expand Up @@ -703,7 +703,7 @@ xlog_cil_free_logvec(
while (!list_empty(lv_chain)) {
lv = list_first_entry(lv_chain, struct xfs_log_vec, lv_list);
list_del_init(&lv->lv_list);
kfree(lv);
kvfree(lv);
}
}

Expand Down Expand Up @@ -1544,7 +1544,7 @@ xlog_cil_process_intents(
set_bit(XFS_LI_WHITEOUT, &ilip->li_flags);
trace_xfs_cil_whiteout_mark(ilip);
len += ilip->li_lv->lv_bytes;
kfree(ilip->li_lv);
kvfree(ilip->li_lv);
ilip->li_lv = NULL;

xfs_trans_del_item(lip);
Expand Down

0 comments on commit b8c0d6f

Please sign in to comment.