提交 067f96ef 编写于 作者: J Jeff Layton 提交者: J. Bruce Fields

sunrpc: release svc_pool_map reference when serv allocation fails

Currently, it leaks when the allocation fails.
Signed-off-by: NJeff Layton <jlayton@primarydata.com>
Signed-off-by: NJ. Bruce Fields <bfields@redhat.com>
上级 8d65ef76
......@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册