aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--net/sunrpc/svc.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/net/sunrpc/svc.c b/net/sunrpc/svc.c
index d2d61bfa3306..918edc310fd1 100644
--- a/net/sunrpc/svc.c
+++ b/net/sunrpc/svc.c
@@ -454,8 +454,15 @@ __svc_create(struct svc_program *prog, unsigned int bufsize, int npools,
454 spin_lock_init(&pool->sp_lock); 454 spin_lock_init(&pool->sp_lock);
455 } 455 }
456 456
457 /* Remove any stale portmap registrations */ 457 if (svc_uses_rpcbind(serv)) {
458 svc_unregister(serv); 458 if (svc_rpcb_setup(serv) < 0) {
459 kfree(serv->sv_pools);
460 kfree(serv);
461 return NULL;
462 }
463 if (!serv->sv_shutdown)
464 serv->sv_shutdown = svc_rpcb_cleanup;
465 }
459 466
460 return serv; 467 return serv;
461} 468}