summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2022-08-26 10:43:12 +0200
committerJeremy Allison <jra@samba.org>2022-09-20 00:34:35 +0000
commit45253acc81e613d0ab6a47d55c008f95af421bf1 (patch)
tree61b9ebf5cd0fe535c58ccdec02f79cccf1cebb0d
parentd42bb5d831ccc2e5134a2c3776546e1dda2736ac (diff)
downloadsamba-45253acc81e613d0ab6a47d55c008f95af421bf1.tar.gz
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 <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
-rw-r--r--source3/locking/locking.c4
1 files changed, 2 insertions, 2 deletions
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;