Signed-off-by: Xiubo Li <xiubli@xxxxxxxxxx> --- fs/ceph/inode.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/fs/ceph/inode.c b/fs/ceph/inode.c index 1c775a365b5e..83f18b058d8c 100644 --- a/fs/ceph/inode.c +++ b/fs/ceph/inode.c @@ -2253,7 +2253,7 @@ static int fill_fscrypt_truncate(struct inode *inode, loff_t pos, orig_pos = round_down(attr->ia_size, CEPH_FSCRYPT_BLOCK_SIZE); u64 block = orig_pos >> CEPH_FSCRYPT_BLOCK_SHIFT; struct ceph_pagelist *pagelist = NULL; - struct kvec iov; + struct kvec iov = {0}; struct iov_iter iter; struct page *page = NULL; struct ceph_fscrypt_truncate_size_header header; @@ -2364,7 +2364,8 @@ static int fill_fscrypt_truncate(struct inode *inode, dout("%s %p size dropping cap refs on %s\n", __func__, inode, ceph_cap_string(got)); ceph_put_cap_refs(ci, got); - kunmap_local(iov.iov_base); + if (iov.iov_base) + kunmap_local(iov.iov_base); if (page) __free_pages(page, 0); if (ret && pagelist) -- 2.36.0.rc1