public inbox for linux-fsdevel@vger.kernel.org
 help / color / mirror / Atom feed
From: Ethan Tidmore <ethantidmore06@gmail.com>
To: linkinjeon@kernel.org, hyc.lee@gmail.com
Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
	Ethan Tidmore <ethantidmore06@gmail.com>
Subject: [PATCH 2/3] ntfs: Add missing error code
Date: Thu, 26 Feb 2026 10:09:05 -0600	[thread overview]
Message-ID: <20260226160906.7175-3-ethantidmore06@gmail.com> (raw)
In-Reply-To: <20260226160906.7175-1-ethantidmore06@gmail.com>

If ntfs_attr_iget() fails no error code is assigned to be returned.

Detected by Smatch:
fs/ntfs/attrib.c:2665 ntfs_attr_add() warn:
missing error code 'err'

Signed-off-by: Ethan Tidmore <ethantidmore06@gmail.com>
---
 fs/ntfs/attrib.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/fs/ntfs/attrib.c b/fs/ntfs/attrib.c
index e260540eb7c5..71ad870eceac 100644
--- a/fs/ntfs/attrib.c
+++ b/fs/ntfs/attrib.c
@@ -2661,6 +2661,7 @@ int ntfs_attr_add(struct ntfs_inode *ni, __le32 type,
 	/* Open new attribute and resize it. */
 	attr_vi = ntfs_attr_iget(VFS_I(ni), type, name, name_len);
 	if (IS_ERR(attr_vi)) {
+		err = PTR_ERR(attr_vi);
 		ntfs_error(sb, "Failed to open just added attribute");
 		goto rm_attr_err_out;
 	}
-- 
2.53.0


  parent reply	other threads:[~2026-02-26 16:09 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-26 16:09 [PATCH 0/3] ntfs: Bug fixes for attrib.c Ethan Tidmore
2026-02-26 16:09 ` [PATCH 1/3] ntfs: Place check before dereference Ethan Tidmore
2026-02-27  2:32   ` Hyunchul Lee
2026-02-26 16:09 ` Ethan Tidmore [this message]
2026-02-27  2:37   ` [PATCH 2/3] ntfs: Add missing error code Hyunchul Lee
2026-02-26 16:09 ` [PATCH 3/3] ntfs: Fix possible deadlock Ethan Tidmore
2026-02-27  2:38   ` Hyunchul Lee
2026-02-27  9:44 ` [PATCH 0/3] ntfs: Bug fixes for attrib.c Namjae Jeon

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=20260226160906.7175-3-ethantidmore06@gmail.com \
    --to=ethantidmore06@gmail.com \
    --cc=hyc.lee@gmail.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox