From: Ralph Boehme Date: Sat, 9 Aug 2025 09:41:45 +0000 (+0200) Subject: s3/locking: modernize file_has_brlocks() X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=0fdd231f80eb9afe783e065c50b0f93c813d0857;p=thirdparty%2Fsamba.git s3/locking: modernize file_has_brlocks() 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 Reviewed-by: Volker Lendecke --- diff --git a/source3/locking/brlock.c b/source3/locking/brlock.c index 7ef8fabdf39..2560df1fb0e 100644 --- a/source3/locking/brlock.c +++ b/source3/locking/brlock.c @@ -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); }