public inbox for ntfs3@lists.linux.dev
 help / color / mirror / Atom feed
* [PATCH v1 1/1] fs/ntfs3: Fix compilation error
@ 2024-04-23 20:56 Andy Shevchenko
  2024-04-24 14:48 ` Andy Shevchenko
  0 siblings, 1 reply; 2+ messages in thread
From: Andy Shevchenko @ 2024-04-23 20:56 UTC (permalink / raw)
  To: Konstantin Komarov, ntfs3, linux-kernel; +Cc: Andy Shevchenko

Compilation with CONFIG_WERROR=y, which is default, is broken:

  fs/ntfs3/super.c:1247:26: error: variable 'attr' is uninitialized when used here [-Werror,-Wuninitialized]

  attr = ni_find_attr(ni, attr, NULL, ATTR_VOL_INFO, NULL, 0, NULL, NULL);
				^~~~
Pass NULL instead.

Fixes: 82cae269cfa9 ("fs/ntfs3: Add initialization of super block")
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 fs/ntfs3/super.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/ntfs3/super.c b/fs/ntfs3/super.c
index 4a514931269e..fa3cc2b6d34a 100644
--- a/fs/ntfs3/super.c
+++ b/fs/ntfs3/super.c
@@ -1244,7 +1244,7 @@ static int ntfs_fill_super(struct super_block *sb, struct fs_context *fc)
 
 	ni = ntfs_i(inode);
 
-	attr = ni_find_attr(ni, attr, NULL, ATTR_VOL_INFO, NULL, 0, NULL, NULL);
+	attr = ni_find_attr(ni, NULL, NULL, ATTR_VOL_INFO, NULL, 0, NULL, NULL);
 	if (!attr || is_attr_ext(attr) ||
 	    !(info = resident_data_ex(attr, SIZEOF_ATTRIBUTE_VOLUME_INFO))) {
 		ntfs_err(sb, "$Volume is corrupted.");
-- 
2.43.0.rc1.1336.g36b5255a03ac


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH v1 1/1] fs/ntfs3: Fix compilation error
  2024-04-23 20:56 [PATCH v1 1/1] fs/ntfs3: Fix compilation error Andy Shevchenko
@ 2024-04-24 14:48 ` Andy Shevchenko
  0 siblings, 0 replies; 2+ messages in thread
From: Andy Shevchenko @ 2024-04-24 14:48 UTC (permalink / raw)
  To: Konstantin Komarov, ntfs3, linux-kernel

On Tue, Apr 23, 2024 at 11:56:34PM +0300, Andy Shevchenko wrote:
> Compilation with CONFIG_WERROR=y, which is default, is broken:
> 
>   fs/ntfs3/super.c:1247:26: error: variable 'attr' is uninitialized when used here [-Werror,-Wuninitialized]
> 
>   attr = ni_find_attr(ni, attr, NULL, ATTR_VOL_INFO, NULL, 0, NULL, NULL);
> 				^~~~
> Pass NULL instead.

Hmm... Something weird is going on. I'm looking now into the code and
have no clue why compiler is not okay with this code. The proposed patch
seems incorrect anyway.

-- 
With Best Regards,
Andy Shevchenko



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-04-24 14:48 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-04-23 20:56 [PATCH v1 1/1] fs/ntfs3: Fix compilation error Andy Shevchenko
2024-04-24 14:48 ` Andy Shevchenko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox