summaryrefslogtreecommitdiffstats
path: root/xlators/protocol/client/src
diff options
context:
space:
mode:
Diffstat (limited to 'xlators/protocol/client/src')
-rw-r--r--xlators/protocol/client/src/client-lk.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/xlators/protocol/client/src/client-lk.c b/xlators/protocol/client/src/client-lk.c
index 01613b7..679e198 100644
--- a/xlators/protocol/client/src/client-lk.c
+++ b/xlators/protocol/client/src/client-lk.c
@@ -360,10 +360,12 @@ delete_granted_locks_owner(fd_t *fd, gf_lkowner_t *owner)
pthread_spin_unlock(&conf->fd_lock);
- list_for_each_entry_safe(lock, tmp, &delete_list, list)
- {
- list_del_init(&lock->list);
- destroy_client_lock(lock);
+ if (!list_empty(&delete_list)) {
+ list_for_each_entry_safe(lock, tmp, &delete_list, list)
+ {
+ list_del_init(&lock->list);
+ destroy_client_lock(lock);
+ }
}
/* FIXME: Need to actually print the locks instead of count */