@@ -795,9 +795,9 @@ create_posix_buf(umode_t mode)
}
static int
-add_posix_context(struct kvec *iov, unsigned int *num_iovec, umode_t mode)
+add_posix_context(struct smb2_create_req *req,
+ struct kvec *iov, unsigned int *num_iovec, umode_t mode)
{
- struct smb2_create_req *req = iov[0].iov_base;
unsigned int num = *num_iovec;
iov[num].iov_base = create_posix_buf(mode);
@@ -2694,7 +2694,7 @@ int smb311_posix_mkdir(const unsigned int xid, struct inode *inode,
if (tcon->posix_extensions) {
/* resource #3: posix buf */
- rc = add_posix_context(iov, &n_iov, mode);
+ rc = add_posix_context(req, iov, &n_iov, mode);
if (rc)
goto err_free_req;
pc_buf = iov[n_iov-1].iov_base;
@@ -2863,7 +2863,7 @@ SMB2_open_init(struct cifs_tcon *tcon, struct TCP_Server_Info *server,
cpu_to_le32(iov[n_iov-1].iov_len);
}
- rc = add_posix_context(iov, &n_iov, oparms->mode);
+ rc = add_posix_context(req, iov, &n_iov, oparms->mode);
if (rc)
return rc;
}
We have the correctly-typed struct smb2_create_req * available in the caller. Signed-off-by: Volker Lendecke <vl@samba.org> --- fs/cifs/smb2pdu.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)