nfsd: minor nfsd_svc() cleanup
authorJ. Bruce Fields <bfields@redhat.com>
Wed, 21 Jul 2010 22:31:42 +0000 (18:31 -0400)
committerJ. Bruce Fields <bfields@redhat.com>
Fri, 23 Jul 2010 12:51:27 +0000 (08:51 -0400)
More idiomatic to put the error case in the if clause.

Signed-off-by: J. Bruce Fields <bfields@redhat.com>
fs/nfsd/nfssvc.c

index 62a6c4474d136a72bf53b4cd6ab4ad92b60fc3ca..92173bde32d21e2a2f3ac01e9dcdd9a9707069df 100644 (file)
@@ -443,12 +443,13 @@ nfsd_svc(unsigned short port, int nrservs)
        if (error)
                goto out_shutdown;
        error = svc_set_num_threads(nfsd_serv, NULL, nrservs);
-       if (error == 0)
-               /* We are holding a reference to nfsd_serv which
-                * we don't want to count in the return value,
-                * so subtract 1
-                */
-               error = nfsd_serv->sv_nrthreads - 1;
+       if (error)
+               goto out_destroy;
+       /* We are holding a reference to nfsd_serv which
+        * we don't want to count in the return value,
+        * so subtract 1
+        */
+       error = nfsd_serv->sv_nrthreads - 1;
 out_destroy:
        svc_destroy(nfsd_serv);         /* Release server */
 out_shutdown: