Commit ddb17dc8 authored by Konstantin Komarov's avatar Konstantin Komarov

fs/ntfs3: Use kvfree to free memory allocated by kvmalloc

Signed-off-by: default avatarKonstantin Komarov <almaz.alexandrovich@paragon-software.com>
parent 4cdfb6e7
...@@ -29,7 +29,7 @@ static inline bool al_is_valid_le(const struct ntfs_inode *ni, ...@@ -29,7 +29,7 @@ static inline bool al_is_valid_le(const struct ntfs_inode *ni,
void al_destroy(struct ntfs_inode *ni) void al_destroy(struct ntfs_inode *ni)
{ {
run_close(&ni->attr_list.run); run_close(&ni->attr_list.run);
kfree(ni->attr_list.le); kvfree(ni->attr_list.le);
ni->attr_list.le = NULL; ni->attr_list.le = NULL;
ni->attr_list.size = 0; ni->attr_list.size = 0;
ni->attr_list.dirty = false; ni->attr_list.dirty = false;
...@@ -318,7 +318,7 @@ int al_add_le(struct ntfs_inode *ni, enum ATTR_TYPE type, const __le16 *name, ...@@ -318,7 +318,7 @@ int al_add_le(struct ntfs_inode *ni, enum ATTR_TYPE type, const __le16 *name,
memcpy(ptr, al->le, off); memcpy(ptr, al->le, off);
memcpy(Add2Ptr(ptr, off + sz), le, old_size - off); memcpy(Add2Ptr(ptr, off + sz), le, old_size - off);
le = Add2Ptr(ptr, off); le = Add2Ptr(ptr, off);
kfree(al->le); kvfree(al->le);
al->le = ptr; al->le = ptr;
} else { } else {
memmove(Add2Ptr(le, sz), le, old_size - off); memmove(Add2Ptr(le, sz), le, old_size - off);
......
...@@ -124,7 +124,7 @@ void wnd_close(struct wnd_bitmap *wnd) ...@@ -124,7 +124,7 @@ void wnd_close(struct wnd_bitmap *wnd)
{ {
struct rb_node *node, *next; struct rb_node *node, *next;
kfree(wnd->free_bits); kvfree(wnd->free_bits);
wnd->free_bits = NULL; wnd->free_bits = NULL;
run_close(&wnd->run); run_close(&wnd->run);
...@@ -1360,7 +1360,7 @@ int wnd_extend(struct wnd_bitmap *wnd, size_t new_bits) ...@@ -1360,7 +1360,7 @@ int wnd_extend(struct wnd_bitmap *wnd, size_t new_bits)
memcpy(new_free, wnd->free_bits, wnd->nwnd * sizeof(short)); memcpy(new_free, wnd->free_bits, wnd->nwnd * sizeof(short));
memset(new_free + wnd->nwnd, 0, memset(new_free + wnd->nwnd, 0,
(new_wnd - wnd->nwnd) * sizeof(short)); (new_wnd - wnd->nwnd) * sizeof(short));
kfree(wnd->free_bits); kvfree(wnd->free_bits);
wnd->free_bits = new_free; wnd->free_bits = new_free;
} }
......
...@@ -778,7 +778,7 @@ static int ni_try_remove_attr_list(struct ntfs_inode *ni) ...@@ -778,7 +778,7 @@ static int ni_try_remove_attr_list(struct ntfs_inode *ni)
run_deallocate(sbi, &ni->attr_list.run, true); run_deallocate(sbi, &ni->attr_list.run, true);
run_close(&ni->attr_list.run); run_close(&ni->attr_list.run);
ni->attr_list.size = 0; ni->attr_list.size = 0;
kfree(ni->attr_list.le); kvfree(ni->attr_list.le);
ni->attr_list.le = NULL; ni->attr_list.le = NULL;
ni->attr_list.dirty = false; ni->attr_list.dirty = false;
...@@ -927,7 +927,7 @@ int ni_create_attr_list(struct ntfs_inode *ni) ...@@ -927,7 +927,7 @@ int ni_create_attr_list(struct ntfs_inode *ni)
return 0; return 0;
out: out:
kfree(ni->attr_list.le); kvfree(ni->attr_list.le);
ni->attr_list.le = NULL; ni->attr_list.le = NULL;
ni->attr_list.size = 0; ni->attr_list.size = 0;
return err; return err;
......
...@@ -625,7 +625,7 @@ static void ntfs3_free_sbi(struct ntfs_sb_info *sbi) ...@@ -625,7 +625,7 @@ static void ntfs3_free_sbi(struct ntfs_sb_info *sbi)
{ {
kfree(sbi->new_rec); kfree(sbi->new_rec);
kvfree(ntfs_put_shared(sbi->upcase)); kvfree(ntfs_put_shared(sbi->upcase));
kfree(sbi->def_table); kvfree(sbi->def_table);
kfree(sbi->compress.lznt); kfree(sbi->compress.lznt);
#ifdef CONFIG_NTFS3_LZX_XPRESS #ifdef CONFIG_NTFS3_LZX_XPRESS
xpress_free_decompressor(sbi->compress.xpress); xpress_free_decompressor(sbi->compress.xpress);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment