Skip to content

Commit

Permalink
sunrpc: release svc_pool_map reference when serv allocation fails
Browse files Browse the repository at this point in the history
Currently, it leaks when the allocation fails.

Signed-off-by: Jeff Layton <jlayton@primarydata.com>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
  • Loading branch information
Jeff Layton authored and J. Bruce Fields committed Dec 1, 2014
1 parent 8d65ef7 commit 067f96e
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions net/sunrpc/svc.c
Original file line number Diff line number Diff line change
Expand Up @@ -503,13 +503,15 @@ svc_create_pooled(struct svc_program *prog, unsigned int bufsize,
unsigned int npools = svc_pool_map_get();

serv = __svc_create(prog, bufsize, npools, shutdown);
if (!serv)
goto out_err;

if (serv != NULL) {
serv->sv_function = func;
serv->sv_module = mod;
}

serv->sv_function = func;
serv->sv_module = mod;
return serv;
out_err:
svc_pool_map_put();
return NULL;
}
EXPORT_SYMBOL_GPL(svc_create_pooled);

Expand Down

0 comments on commit 067f96e

Please sign in to comment.