smb: client, common: fix fortify warnings
[platform/kernel/linux-starfive.git] / fs / smb / client / smb2pdu.c
index 76a0b9d..5276992 100644 (file)
@@ -3401,12 +3401,10 @@ __SMB2_close(const unsigned int xid, struct cifs_tcon *tcon,
        } else {
                trace_smb3_close_done(xid, persistent_fid, tcon->tid,
                                      ses->Suid);
-               /*
-                * Note that have to subtract 4 since struct network_open_info
-                * has a final 4 byte pad that close response does not have
-                */
                if (pbuf)
-                       memcpy(pbuf, (char *)&rsp->CreationTime, sizeof(*pbuf) - 4);
+                       memcpy(&pbuf->network_open_info,
+                              &rsp->network_open_info,
+                              sizeof(pbuf->network_open_info));
        }
 
        atomic_dec(&tcon->num_remote_opens);