]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
smbd: Remove a no-op call to init_strict_lock_struct
authorVolker Lendecke <vl@samba.org>
Thu, 16 May 2024 10:05:38 +0000 (12:05 +0200)
committerAndrew Bartlett <abartlet@samba.org>
Wed, 22 May 2024 04:23:29 +0000 (04:23 +0000)
"lock" is a variable on the stack, and initializing it is all that
init_strict_lock_struct does. We've done the corresponding checks
already in smbd_smb2_read_send

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
source3/smbd/smb2_read.c

index db0aca7ac6835ea912f78f0a10cdb8bcb5e1615f..6c595a7c3406449b225131eb599efa27ee47e624 100644 (file)
@@ -204,7 +204,6 @@ static int smb2_smb2_read_state_deny_destructor(struct smbd_smb2_read_state *sta
 /* struct smbd_smb2_read_state destructor. Send the SMB2_READ data. */
 static int smb2_sendfile_send_data(struct smbd_smb2_read_state *state)
 {
-       struct lock_struct lock;
        uint32_t in_length = state->in_length;
        uint64_t in_offset = state->in_offset;
        files_struct *fsp = state->fsp;
@@ -332,14 +331,6 @@ normal_read:
                }
        }
 
-       init_strict_lock_struct(fsp,
-                               fsp->op->global->open_persistent_id,
-                               in_offset,
-                               in_length,
-                               READ_LOCK,
-                               lp_posix_cifsu_locktype(fsp),
-                               &lock);
-
        *pstatus = NT_STATUS_OK;
        return 0;
 }