cifs: fix uninitialised var in smb2_compound_op()
authorPaulo Alcantara <pc@cjr.nz>
Tue, 4 Oct 2022 18:10:09 +0000 (15:10 -0300)
committerSteve French <stfrench@microsoft.com>
Thu, 13 Oct 2022 14:36:38 +0000 (09:36 -0500)
Fix uninitialised variable @idata when calling smb2_compound_op() with
SMB2_OP_POSIX_QUERY_INFO.

Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Paulo Alcantara (SUSE) <pc@cjr.nz>
Reviewed-by: Ronnie Sahlberg <lsahlber@redhat.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
fs/cifs/smb2inode.c

index adf71b3..a6640e6 100644 (file)
@@ -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)