diff --git a/fs/lockd/host.c b/fs/lockd/host.c index 0257a5594524b92e28b502cefffe80e4285f959b..fb24a97303458f1b282f81111895c105e2c0399f 100644 --- a/fs/lockd/host.c +++ b/fs/lockd/host.c @@ -103,8 +103,8 @@ nlm_lookup_host(int server, const struct sockaddr_in *sin, continue; /* See if we have an NSM handle for this client */ - if (!nsm && (nsm = host->h_nsmhandle) != 0) - atomic_inc(&nsm->sm_count); + if (!nsm) + nsm = host->h_nsmhandle; if (host->h_proto != proto) continue; @@ -120,6 +120,8 @@ nlm_lookup_host(int server, const struct sockaddr_in *sin, nlm_get_host(host); goto out; } + if (nsm) + atomic_inc(&nsm->sm_count); host = NULL;