diff options
-rw-r--r-- | fs/lockd/host.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/fs/lockd/host.c b/fs/lockd/host.c index c3f119426d83..960911c4a11c 100644 --- a/fs/lockd/host.c +++ b/fs/lockd/host.c | |||
@@ -529,12 +529,10 @@ nsm_release(struct nsm_handle *nsm) | |||
529 | { | 529 | { |
530 | if (!nsm) | 530 | if (!nsm) |
531 | return; | 531 | return; |
532 | mutex_lock(&nsm_mutex); | ||
532 | if (atomic_dec_and_test(&nsm->sm_count)) { | 533 | if (atomic_dec_and_test(&nsm->sm_count)) { |
533 | mutex_lock(&nsm_mutex); | 534 | list_del(&nsm->sm_link); |
534 | if (atomic_read(&nsm->sm_count) == 0) { | 535 | kfree(nsm); |
535 | list_del(&nsm->sm_link); | ||
536 | kfree(nsm); | ||
537 | } | ||
538 | mutex_unlock(&nsm_mutex); | ||
539 | } | 536 | } |
537 | mutex_unlock(&nsm_mutex); | ||
540 | } | 538 | } |