ntfs3.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
* [PATCH] fs/ntfs3: uninitialized variable in ntfs_set_acl_ex()
@ 2022-08-08  8:34 Dan Carpenter
  2022-08-10 16:18 ` Konstantin Komarov
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2022-08-08  8:34 UTC (permalink / raw)
  To: Konstantin Komarov; +Cc: ntfs3, kernel-janitors

The goto out calls kfree(value) on an uninitialized pointer.  Just
return directly as the other error paths do.

Fixes: 460bbf2990b3 ("fs/ntfs3: Do not change mode if ntfs_set_ea failed")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
 fs/ntfs3/xattr.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/ntfs3/xattr.c b/fs/ntfs3/xattr.c
index 02f6a933ee79..5bdff12a1232 100644
--- a/fs/ntfs3/xattr.c
+++ b/fs/ntfs3/xattr.c
@@ -568,7 +568,7 @@ static noinline int ntfs_set_acl_ex(struct user_namespace *mnt_userns,
 			err = posix_acl_update_mode(mnt_userns, inode, &mode,
 						    &acl);
 			if (err)
-				goto out;
+				return err;
 		}
 		name = XATTR_NAME_POSIX_ACL_ACCESS;
 		name_len = sizeof(XATTR_NAME_POSIX_ACL_ACCESS) - 1;
-- 
2.35.1


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

* Re: [PATCH] fs/ntfs3: uninitialized variable in ntfs_set_acl_ex()
  2022-08-08  8:34 [PATCH] fs/ntfs3: uninitialized variable in ntfs_set_acl_ex() Dan Carpenter
@ 2022-08-10 16:18 ` Konstantin Komarov
  0 siblings, 0 replies; 2+ messages in thread
From: Konstantin Komarov @ 2022-08-10 16:18 UTC (permalink / raw)
  To: Dan Carpenter; +Cc: ntfs3, kernel-janitors



On 8/8/22 11:34, Dan Carpenter wrote:
> The goto out calls kfree(value) on an uninitialized pointer.  Just
> return directly as the other error paths do.
> 
> Fixes: 460bbf2990b3 ("fs/ntfs3: Do not change mode if ntfs_set_ea failed")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> ---
>   fs/ntfs3/xattr.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/fs/ntfs3/xattr.c b/fs/ntfs3/xattr.c
> index 02f6a933ee79..5bdff12a1232 100644
> --- a/fs/ntfs3/xattr.c
> +++ b/fs/ntfs3/xattr.c
> @@ -568,7 +568,7 @@ static noinline int ntfs_set_acl_ex(struct user_namespace *mnt_userns,
>   			err = posix_acl_update_mode(mnt_userns, inode, &mode,
>   						    &acl);
>   			if (err)
> -				goto out;
> +				return err;
>   		}
>   		name = XATTR_NAME_POSIX_ACL_ACCESS;
>   		name_len = sizeof(XATTR_NAME_POSIX_ACL_ACCESS) - 1;

Thanks for patch, applied!

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

end of thread, other threads:[~2022-08-10 16:18 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-08  8:34 [PATCH] fs/ntfs3: uninitialized variable in ntfs_set_acl_ex() Dan Carpenter
2022-08-10 16:18 ` Konstantin Komarov

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 NNTP newsgroup(s).