diff options
author | Volker Lendecke <vl@samba.org> | 2014-03-20 14:53:14 +0100 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2014-03-21 19:20:17 +0100 |
commit | ede6f448215a4ee81a1c7701c1cead2cc0a33198 (patch) | |
tree | 6e31291abe07a7e0c4e5e9c907a28e94a9fd654c /source3/locking | |
parent | c416b34648b6734b7b612d51fa9e151a201768da (diff) | |
download | samba-ede6f448215a4ee81a1c7701c1cead2cc0a33198.tar.gz |
smbd: Avoid checking the_lock->id for fresh locks
If we just fetched the lock, this check will always be true.
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Diffstat (limited to 'source3/locking')
-rw-r--r-- | source3/locking/share_mode_lock.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/source3/locking/share_mode_lock.c b/source3/locking/share_mode_lock.c index 5d0874c3be1..a34f3043b1d 100644 --- a/source3/locking/share_mode_lock.c +++ b/source3/locking/share_mode_lock.c @@ -385,15 +385,16 @@ struct share_mode_lock *get_share_mode_lock( } talloc_set_destructor(the_lock, the_lock_destructor); } else { + if (!file_id_equal(&the_lock->data->id, &id)) { + DEBUG(1, ("Can not lock two share modes " + "simultaneously\n")); + goto fail; + } if (talloc_reference(lck, the_lock) == NULL) { DEBUG(1, ("talloc_reference failed\n")); goto fail; } } - if (!file_id_equal(&the_lock->data->id, &id)) { - DEBUG(1, ("Can not lock two share modes simultaneously\n")); - goto fail; - } lck->data = the_lock->data; return lck; fail: |