diff options
| author | Jeff Layton <jlayton@primarydata.com> | 2014-11-19 07:51:13 -0500 |
|---|---|---|
| committer | J. Bruce Fields <bfields@redhat.com> | 2014-12-01 14:45:27 -0500 |
| commit | 067f96ef17455800bfbf87b743960e301e0b8e40 (patch) | |
| tree | 2d1d2f92da1b94943a36917163bb78db23333387 | |
| parent | 8d65ef760d50cc625c5364cba89be838b21c66a7 (diff) | |
sunrpc: release svc_pool_map reference when serv allocation fails
Currently, it leaks when the allocation fails.
Signed-off-by: Jeff Layton <jlayton@primarydata.com>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
| -rw-r--r-- | net/sunrpc/svc.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/net/sunrpc/svc.c b/net/sunrpc/svc.c index 349c98f9818b..537add5309cc 100644 --- a/net/sunrpc/svc.c +++ b/net/sunrpc/svc.c | |||
| @@ -503,13 +503,15 @@ svc_create_pooled(struct svc_program *prog, unsigned int bufsize, | |||
| 503 | unsigned int npools = svc_pool_map_get(); | 503 | unsigned int npools = svc_pool_map_get(); |
| 504 | 504 | ||
| 505 | serv = __svc_create(prog, bufsize, npools, shutdown); | 505 | serv = __svc_create(prog, bufsize, npools, shutdown); |
| 506 | if (!serv) | ||
| 507 | goto out_err; | ||
| 506 | 508 | ||
| 507 | if (serv != NULL) { | 509 | serv->sv_function = func; |
| 508 | serv->sv_function = func; | 510 | serv->sv_module = mod; |
| 509 | serv->sv_module = mod; | ||
| 510 | } | ||
| 511 | |||
| 512 | return serv; | 511 | return serv; |
| 512 | out_err: | ||
| 513 | svc_pool_map_put(); | ||
| 514 | return NULL; | ||
| 513 | } | 515 | } |
| 514 | EXPORT_SYMBOL_GPL(svc_create_pooled); | 516 | EXPORT_SYMBOL_GPL(svc_create_pooled); |
| 515 | 517 | ||
