]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
smbd: Simplify smb_set_file_allocation_info()
authorVolker Lendecke <vl@samba.org>
Sat, 23 Nov 2024 15:23:19 +0000 (16:23 +0100)
committerMartin Schwenke <martins@samba.org>
Mon, 2 Dec 2024 04:53:33 +0000 (04:53 +0000)
We've asserted fsp!=NULL in the caller

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
source3/smbd/smb2_trans2.c

index ec20586f9fd2d2372b157da9ae821c63fce68860..c7dcef16756ed88b3fcd382820da7f1fefc26870 100644 (file)
@@ -4976,10 +4976,7 @@ static NTSTATUS smb_set_file_allocation_info(connection_struct *conn,
                  "allocation size to %.0f\n", smb_fname_str_dbg(smb_fname),
                  (double)allocation_size));
 
-       if (fsp &&
-           !fsp->fsp_flags.is_pathref &&
-           fsp_get_io_fd(fsp) != -1)
-       {
+       if (!fsp->fsp_flags.is_pathref && (fsp_get_io_fd(fsp) != -1)) {
                /* Open file handle. */
                status = check_any_access_fsp(fsp, FILE_WRITE_DATA);
                if (!NT_STATUS_IS_OK(status)) {