cifs: Fix uninitialized memory reads for oparms.mode
[linux-2.6-microblaze.git] / fs / cifs / file.c
index 7eb476a..e216bc9 100644 (file)
@@ -260,14 +260,15 @@ static int cifs_nt_open(const char *full_path, struct inode *inode, struct cifs_
        if (f_flags & O_DIRECT)
                create_options |= CREATE_NO_BUFFER;
 
-       oparms.tcon = tcon;
-       oparms.cifs_sb = cifs_sb;
-       oparms.desired_access = desired_access;
-       oparms.create_options = cifs_create_options(cifs_sb, create_options);
-       oparms.disposition = disposition;
-       oparms.path = full_path;
-       oparms.fid = fid;
-       oparms.reconnect = false;
+       oparms = (struct cifs_open_parms) {
+               .tcon = tcon,
+               .cifs_sb = cifs_sb,
+               .desired_access = desired_access,
+               .create_options = cifs_create_options(cifs_sb, create_options),
+               .disposition = disposition,
+               .path = full_path,
+               .fid = fid,
+       };
 
        rc = server->ops->open(xid, &oparms, oplock, buf);
        if (rc)
@@ -848,14 +849,16 @@ cifs_reopen_file(struct cifsFileInfo *cfile, bool can_flush)
        if (server->ops->get_lease_key)
                server->ops->get_lease_key(inode, &cfile->fid);
 
-       oparms.tcon = tcon;
-       oparms.cifs_sb = cifs_sb;
-       oparms.desired_access = desired_access;
-       oparms.create_options = cifs_create_options(cifs_sb, create_options);
-       oparms.disposition = disposition;
-       oparms.path = full_path;
-       oparms.fid = &cfile->fid;
-       oparms.reconnect = true;
+       oparms = (struct cifs_open_parms) {
+               .tcon = tcon,
+               .cifs_sb = cifs_sb,
+               .desired_access = desired_access,
+               .create_options = cifs_create_options(cifs_sb, create_options),
+               .disposition = disposition,
+               .path = full_path,
+               .fid = &cfile->fid,
+               .reconnect = true,
+       };
 
        /*
         * Can not refresh inode by passing in file_info buf to be returned by