All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH next] ntfs: add missing error code in ntfs_mft_record_alloc()
@ 2026-04-10  6:47 Dan Carpenter
  2026-04-10 23:23 ` Hyunchul Lee
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2026-04-10  6:47 UTC (permalink / raw)
  To: Namjae Jeon; +Cc: Hyunchul Lee, linux-fsdevel, linux-kernel, kernel-janitors

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


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

* Re: [PATCH next] ntfs: add missing error code in ntfs_mft_record_alloc()
  2026-04-10  6:47 [PATCH next] ntfs: add missing error code in ntfs_mft_record_alloc() Dan Carpenter
@ 2026-04-10 23:23 ` Hyunchul Lee
  0 siblings, 0 replies; 2+ messages in thread
From: Hyunchul Lee @ 2026-04-10 23:23 UTC (permalink / raw)
  To: Dan Carpenter; +Cc: Namjae Jeon, linux-fsdevel, linux-kernel, kernel-janitors

2026년 4월 10일 (금) 오후 3:47, Dan Carpenter <error27@gmail.com>님이 작성:
>
> Return -ENOMEM if the kmalloc() fails.  Don't return success.
>
> Fixes: 115380f9a2f9 ("ntfs: update mft operations")
> Signed-off-by: Dan Carpenter <error27@gmail.com>

Looks good to me.

Reviewed-by: Hyunchul Lee <hyc.lee@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
>


-- 
Thanks,
Hyunchul

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

end of thread, other threads:[~2026-04-10 23:23 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-10  6:47 [PATCH next] ntfs: add missing error code in ntfs_mft_record_alloc() Dan Carpenter
2026-04-10 23:23 ` Hyunchul Lee

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.