s4:ntvfs: Remove unneeded NULL check (CID 240771)
authorJoseph Sutton <josephsutton@catalyst.net.nz>
Thu, 5 Oct 2023 21:07:14 +0000 (10:07 +1300)
committerAndrew Bartlett <abartlet@samba.org>
Fri, 13 Oct 2023 02:18:31 +0000 (02:18 +0000)
We’ve already dereferenced ‘pending’ in the init‐clause of the loop, and
won’t reassign it during the loop.

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
source4/ntvfs/posix/pvfs_lock.c

index 54c7a33d3a0f48333c79324070d13971edaa54f8..c113232248e9ca4aba73a895b7e090edb099bb50 100644 (file)
@@ -173,9 +173,7 @@ static void pvfs_pending_lock_continue(void *private_data, enum pvfs_wait_notice
        /* we've now got the pending lock. try and get the rest, which might
           lead to more pending locks */
        for (i=pending->pending_lock+1;i<lck->lockx.in.lock_cnt;i++) {          
-               if (pending) {
-                       pending->pending_lock = i;
-               }
+               pending->pending_lock = i;
 
                status = brlock_lock(pvfs->brl_context,
                                  f->brl_handle,