summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2013-09-03 14:38:47 +0000
committerMichael Adam <obnox@samba.org>2013-09-06 13:33:39 +0200
commita7d742937644373e0e2e75003d04c118e34385ff (patch)
treedc27058f70d4ee61817301d730090d8f8d669fc8 /source3
parent196da5925b6263b616149f8c4c8d67e1572dea4f (diff)
downloadsamba-a7d742937644373e0e2e75003d04c118e34385ff.tar.gz
samba-a7d742937644373e0e2e75003d04c118e34385ff.tar.bz2
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>
Diffstat (limited to 'source3')
-rw-r--r--source3/locking/locking.c7
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;
}