diff mbox series

[v3,2/2] cifs: fix uninitialised var in smb2_compound_op()

Message ID 20221005230447.9551-2-pc@cjr.nz
State New
Headers show
Series [v3,1/2] cifs: improve symlink handling for smb2+ | expand

Commit Message

Paulo Alcantara Oct. 5, 2022, 11:04 p.m. UTC
Fix uninitialised variable @idata when calling smb2_compound_op() with
SMB2_OP_POSIX_QUERY_INFO.

Fixes: 5079f2691f73 ("cifs: improve symlink handling for smb2+")
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Paulo Alcantara (SUSE) <pc@cjr.nz>
---
v2 -> v3: no changes

 fs/cifs/smb2inode.c | 1 +
 1 file changed, 1 insertion(+)

Comments

ronnie sahlberg Oct. 5, 2022, 11:11 p.m. UTC | #1
reviewed by me

On Thu, 6 Oct 2022 at 09:06, Paulo Alcantara <pc@cjr.nz> wrote:
>
> Fix uninitialised variable @idata when calling smb2_compound_op() with
> SMB2_OP_POSIX_QUERY_INFO.
>
> Fixes: 5079f2691f73 ("cifs: improve symlink handling for smb2+")
> Reported-by: kernel test robot <lkp@intel.com>
> Signed-off-by: Paulo Alcantara (SUSE) <pc@cjr.nz>
> ---
> v2 -> v3: no changes
>
>  fs/cifs/smb2inode.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/fs/cifs/smb2inode.c b/fs/cifs/smb2inode.c
> index adf71b328f32..a6640e6ea58b 100644
> --- a/fs/cifs/smb2inode.c
> +++ b/fs/cifs/smb2inode.c
> @@ -415,6 +415,7 @@ static int smb2_compound_op(const unsigned int xid, struct cifs_tcon *tcon,
>                                                 tcon->tid);
>                 break;
>         case SMB2_OP_POSIX_QUERY_INFO:
> +               idata = ptr;
>                 if (rc == 0 && cfile && cfile->symlink_target) {
>                         idata->symlink_target = kstrdup(cfile->symlink_target, GFP_KERNEL);
>                         if (!idata->symlink_target)
> --
> 2.37.3
>
diff mbox series

Patch

diff --git a/fs/cifs/smb2inode.c b/fs/cifs/smb2inode.c
index adf71b328f32..a6640e6ea58b 100644
--- a/fs/cifs/smb2inode.c
+++ b/fs/cifs/smb2inode.c
@@ -415,6 +415,7 @@  static int smb2_compound_op(const unsigned int xid, struct cifs_tcon *tcon,
 						tcon->tid);
 		break;
 	case SMB2_OP_POSIX_QUERY_INFO:
+		idata = ptr;
 		if (rc == 0 && cfile && cfile->symlink_target) {
 			idata->symlink_target = kstrdup(cfile->symlink_target, GFP_KERNEL);
 			if (!idata->symlink_target)