All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <error27@gmail.com>
To: Namjae Jeon <linkinjeon@kernel.org>
Cc: Hyunchul Lee <hyc.lee@gmail.com>,
	linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
	kernel-janitors@vger.kernel.org
Subject: [PATCH next] ntfs: add missing error code in ntfs_mft_record_alloc()
Date: Fri, 10 Apr 2026 09:47:25 +0300	[thread overview]
Message-ID: <adic_St-SP3UONMV@stanley.mountain> (raw)

Return -ENOMEM if the kmalloc() fails.  Don't return success.

Fixes: 115380f9a2f9 ("ntfs: update mft operations")
Signed-off-by: Dan Carpenter <error27@gmail.com>
---
This email is a free service from the Smatch-CI project [smatch.sf.net].

I have wanted to avoid sending patches but it was easier to fix it than
explain the warning.  :P

    fs/ntfs/namei.c:677 __ntfs_create() error: uninitialized symbol 'ni_mrec'.

 fs/ntfs/mft.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/fs/ntfs/mft.c b/fs/ntfs/mft.c
index bf028c1aea26..0c545fd08b66 100644
--- a/fs/ntfs/mft.c
+++ b/fs/ntfs/mft.c
@@ -2503,6 +2503,7 @@ int ntfs_mft_record_alloc(struct ntfs_volume *vol, const int mode,
 			folio_unlock(folio);
 			kunmap_local(m);
 			folio_put(folio);
+			err = -ENOMEM;
 			goto undo_mftbmp_alloc;
 		}
 
-- 
2.53.0


             reply	other threads:[~2026-04-10  6:47 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-10  6:47 Dan Carpenter [this message]
2026-04-10 23:23 ` [PATCH next] ntfs: add missing error code in ntfs_mft_record_alloc() Hyunchul Lee

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=adic_St-SP3UONMV@stanley.mountain \
    --to=error27@gmail.com \
    --cc=hyc.lee@gmail.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linkinjeon@kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.