lockd: double unlock in next_host_state()
Subsystems (3)
PATCH 1/1 lockd: double unlock in next_host_state()
We unlock again after we goto out.
Signed-off-by Dan Carpenter <[email protected]>
fs/lockd/host.c +0 -1
@@ -532,7 +532,6 @@ static struct nlm_host *next_host_state(struct hlist_head *cache, host->h_state++;nlm_get_host (host); -mutex_unlock (&nlm_host_mutex); goto out; } }
Quoted 9 lines · Dan Carpenter
We unlock again after we goto out.
Signed-off-by Dan Carpenter <[email protected]>fs/lockd/host.c +0
-0
fs/lockd/host.c static struct nlm_host *next_host_state(struct hlist_head *cache, · line 537
Quoted 7 lines
fs/lockd/host.c +0
-1@@ -532,7 +532,6 @@ static struct nlm_host *next_host_state(struct hlist_head *cache, host->h_state++;nlm_get_host (host); -mutex_unlock (&nlm_host_mutex); goto out; } }
Would it also make sense to replace the "goto out;" with a "break;" ?
Signature · 2 lines
Chuck Lever chuck[dot]lever[at]oracle[dot]com
Quoted 6 lines · Chuck Lever
Quoted 4 lines
fs/lockd/host.c +0
-1-mutex_unlock (&nlm_host_mutex);goto out; } }Would it also make sense to replace the "goto out;" with a "break;" ?
No. for_each_host() is a nested for loop, so a break would only take you out of the inner most loop.
regards,
dan carpenter