]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3/locking: modernize file_has_brlocks()
authorRalph Boehme <slow@samba.org>
Sat, 9 Aug 2025 09:41:45 +0000 (11:41 +0200)
committerVolker Lendecke <vl@samba.org>
Fri, 15 Aug 2025 15:46:35 +0000 (15:46 +0000)
No change in behaviour. Minimizes diff in the next commit that introduce a
behaviour change.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=15894

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
source3/locking/brlock.c

index 7ef8fabdf39a335aa8b25268b7356a03950c3fc6..2560df1fb0e9b34135738308cef82de51cd62b3f 100644 (file)
@@ -2001,11 +2001,12 @@ void brl_set_modified(struct byte_range_lock *br_lck, bool modified)
 
 bool file_has_brlocks(files_struct *fsp)
 {
-       struct byte_range_lock *br_lck;
+       struct byte_range_lock *br_lck = NULL;
 
        br_lck = brl_get_locks_readonly(fsp);
-       if (!br_lck)
+       if (br_lck == NULL) {
                return false;
+       }
 
        return (brl_num_locks(br_lck) > 0);
 }