diff options
author | Volker Lendecke <vl@samba.org> | 2013-09-03 14:38:47 +0000 |
---|---|---|
committer | Michael Adam <obnox@samba.org> | 2013-09-06 13:33:39 +0200 |
commit | a7d742937644373e0e2e75003d04c118e34385ff (patch) | |
tree | dc27058f70d4ee61817301d730090d8f8d669fc8 | |
parent | 196da5925b6263b616149f8c4c8d67e1572dea4f (diff) | |
download | samba-a7d742937644373e0e2e75003d04c118e34385ff.tar.gz samba-a7d742937644373e0e2e75003d04c118e34385ff.tar.xz samba-a7d742937644373e0e2e75003d04c118e34385ff.zip |
smbd: Simplify find_share_mode_entry
There's no point checking the validity of the "entry" argument more
than once
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
-rw-r--r-- | source3/locking/locking.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/source3/locking/locking.c b/source3/locking/locking.c index 5090082ba8..1567f8ffcd 100644 --- a/source3/locking/locking.c +++ b/source3/locking/locking.c @@ -751,10 +751,13 @@ static struct share_mode_entry *find_share_mode_entry(struct share_mode_data *d, { int i; + if (!is_valid_share_mode_entry(entry)) { + return NULL; + } + for (i=0; i<d->num_share_modes; i++) { struct share_mode_entry *e = &d->share_modes[i]; - if (is_valid_share_mode_entry(entry) && - is_valid_share_mode_entry(e) && + if (is_valid_share_mode_entry(e) && share_modes_identical(e, entry)) { return e; } |