From 4bb18ece5bfdc8bf88bf8358c5e94a9d866e18cc Mon Sep 17 00:00:00 2001 From: Joseph Sutton Date: Fri, 6 Oct 2023 10:07:14 +1300 Subject: [PATCH] s4:ntvfs: Remove unneeded NULL check (CID 240771) MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 Reviewed-by: Andrew Bartlett --- source4/ntvfs/posix/pvfs_lock.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/source4/ntvfs/posix/pvfs_lock.c b/source4/ntvfs/posix/pvfs_lock.c index 54c7a33d3a0..c113232248e 100644 --- a/source4/ntvfs/posix/pvfs_lock.c +++ b/source4/ntvfs/posix/pvfs_lock.c @@ -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;ilockx.in.lock_cnt;i++) { - if (pending) { - pending->pending_lock = i; - } + pending->pending_lock = i; status = brlock_lock(pvfs->brl_context, f->brl_handle, -- 2.47.3