From: Stefan Metzmacher Date: Fri, 26 Aug 2022 08:43:12 +0000 (+0200) Subject: s3:locking: let remove_lease_if_stale() use share_mode_lock_file_id() X-Git-Tag: talloc-2.4.0~890 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=45253acc81e613d0ab6a47d55c008f95af421bf1;p=thirdparty%2Fsamba.git s3:locking: let remove_lease_if_stale() use share_mode_lock_file_id() We should avoid dereference 'struct share_mode_lock' as much as possible. BUG: https://bugzilla.samba.org/show_bug.cgi?id=15125 Signed-off-by: Stefan Metzmacher Reviewed-by: Jeremy Allison --- diff --git a/source3/locking/locking.c b/source3/locking/locking.c index d8367aa7d8c..4c20ff2c354 100644 --- a/source3/locking/locking.c +++ b/source3/locking/locking.c @@ -721,7 +721,7 @@ NTSTATUS remove_lease_if_stale(struct share_mode_lock *lck, struct find_lease_ref_state state = { .client_guid = client_guid, .lease_key = lease_key, }; - struct share_mode_data *d = lck->data; + struct file_id id = share_mode_lock_file_id(lck); NTSTATUS status; bool ok; @@ -735,7 +735,7 @@ NTSTATUS remove_lease_if_stale(struct share_mode_lock *lck, return NT_STATUS_RESOURCE_IN_USE; } - status = leases_db_del(client_guid, lease_key, &d->id); + status = leases_db_del(client_guid, lease_key, &id); if (!NT_STATUS_IS_OK(status)) { int level = DBGLVL_DEBUG;