NTFS3 file system kernel mode driver
 help / color / mirror / Atom feed
From: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
To: <ntfs3@lists.linux.dev>
Cc: <linux-kernel@vger.kernel.org>, <linux-fsdevel@vger.kernel.org>
Subject: [PATCH] fs/ntfs3: Use kvfree to free memory allocated by kvmalloc
Date: Tue, 16 Jan 2024 11:26:41 +0300	[thread overview]
Message-ID: <667a5bc4-8cb5-47ce-a7f1-749479b25bec@paragon-software.com> (raw)


Signed-off-by: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
---
  fs/ntfs3/attrlist.c | 4 ++--
  fs/ntfs3/bitmap.c   | 4 ++--
  fs/ntfs3/frecord.c  | 4 ++--
  fs/ntfs3/super.c    | 2 +-
  4 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/fs/ntfs3/attrlist.c b/fs/ntfs3/attrlist.c
index 48e7da47c6b7..9f4bd8d26090 100644
--- a/fs/ntfs3/attrlist.c
+++ b/fs/ntfs3/attrlist.c
@@ -29,7 +29,7 @@ static inline bool al_is_valid_le(const struct 
ntfs_inode *ni,
  void al_destroy(struct ntfs_inode *ni)
  {
      run_close(&ni->attr_list.run);
-    kfree(ni->attr_list.le);
+    kvfree(ni->attr_list.le);
      ni->attr_list.le = NULL;
      ni->attr_list.size = 0;
      ni->attr_list.dirty = false;
@@ -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(Add2Ptr(ptr, off + sz), le, old_size - off);
          le = Add2Ptr(ptr, off);
-        kfree(al->le);
+        kvfree(al->le);
          al->le = ptr;
      } else {
          memmove(Add2Ptr(le, sz), le, old_size - off);
diff --git a/fs/ntfs3/bitmap.c b/fs/ntfs3/bitmap.c
index 63f14a0232f6..845f9b22deef 100644
--- a/fs/ntfs3/bitmap.c
+++ b/fs/ntfs3/bitmap.c
@@ -124,7 +124,7 @@ void wnd_close(struct wnd_bitmap *wnd)
  {
      struct rb_node *node, *next;

-    kfree(wnd->free_bits);
+    kvfree(wnd->free_bits);
      wnd->free_bits = NULL;
      run_close(&wnd->run);

@@ -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));
          memset(new_free + wnd->nwnd, 0,
                 (new_wnd - wnd->nwnd) * sizeof(short));
-        kfree(wnd->free_bits);
+        kvfree(wnd->free_bits);
          wnd->free_bits = new_free;
      }

diff --git a/fs/ntfs3/frecord.c b/fs/ntfs3/frecord.c
index 6ff4f70ba077..2636ab7640ac 100644
--- a/fs/ntfs3/frecord.c
+++ b/fs/ntfs3/frecord.c
@@ -778,7 +778,7 @@ static int ni_try_remove_attr_list(struct ntfs_inode 
*ni)
      run_deallocate(sbi, &ni->attr_list.run, true);
      run_close(&ni->attr_list.run);
      ni->attr_list.size = 0;
-    kfree(ni->attr_list.le);
+    kvfree(ni->attr_list.le);
      ni->attr_list.le = NULL;
      ni->attr_list.dirty = false;

@@ -927,7 +927,7 @@ int ni_create_attr_list(struct ntfs_inode *ni)
      return 0;

  out:
-    kfree(ni->attr_list.le);
+    kvfree(ni->attr_list.le);
      ni->attr_list.le = NULL;
      ni->attr_list.size = 0;
      return err;
diff --git a/fs/ntfs3/super.c b/fs/ntfs3/super.c
index 65ef4b57411f..c55a29793a8d 100644
--- a/fs/ntfs3/super.c
+++ b/fs/ntfs3/super.c
@@ -625,7 +625,7 @@ static void ntfs3_free_sbi(struct ntfs_sb_info *sbi)
  {
      kfree(sbi->new_rec);
      kvfree(ntfs_put_shared(sbi->upcase));
-    kfree(sbi->def_table);
+    kvfree(sbi->def_table);
      kfree(sbi->compress.lznt);
  #ifdef CONFIG_NTFS3_LZX_XPRESS
      xpress_free_decompressor(sbi->compress.xpress);
-- 
2.34.1


             reply	other threads:[~2024-01-16  8:34 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-16  8:26 Konstantin Komarov [this message]
2024-01-16 10:50 ` [PATCH] fs/ntfs3: Use kvfree to free memory allocated by kvmalloc Linux regression tracking (Thorsten Leemhuis)

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=667a5bc4-8cb5-47ce-a7f1-749479b25bec@paragon-software.com \
    --to=almaz.alexandrovich@paragon-software.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ntfs3@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).