Skip to content

Commit 919e57c

Browse files
vlendecsmfrench
authored andcommitted
cifs: Avoid a cast in add_lease_context()
We have the correctly-typed struct smb2_create_req * available in the caller. Signed-off-by: Volker Lendecke <[email protected]> Reviewed-by Ralph Boehme <[email protected]> Signed-off-by: Steve French <[email protected]>
1 parent d2ec43b commit 919e57c

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

fs/cifs/smb2pdu.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2166,10 +2166,11 @@ smb2_parse_contexts(struct TCP_Server_Info *server,
21662166
}
21672167

21682168
static int
2169-
add_lease_context(struct TCP_Server_Info *server, struct kvec *iov,
2169+
add_lease_context(struct TCP_Server_Info *server,
2170+
struct smb2_create_req *req,
2171+
struct kvec *iov,
21702172
unsigned int *num_iovec, u8 *lease_key, __u8 *oplock)
21712173
{
2172-
struct smb2_create_req *req = iov[0].iov_base;
21732174
unsigned int num = *num_iovec;
21742175

21752176
iov[num].iov_base = server->ops->create_lease_buf(lease_key, *oplock);
@@ -2811,7 +2812,7 @@ SMB2_open_init(struct cifs_tcon *tcon, struct TCP_Server_Info *server,
28112812
(oparms->create_options & CREATE_NOT_FILE))
28122813
req->RequestedOplockLevel = *oplock; /* no srv lease support */
28132814
else {
2814-
rc = add_lease_context(server, iov, &n_iov,
2815+
rc = add_lease_context(server, req, iov, &n_iov,
28152816
oparms->fid->lease_key, oplock);
28162817
if (rc)
28172818
return rc;

0 commit comments

Comments
 (0)