提交 066b2118 编写于 作者: M Marcin Slusarz 提交者: David S. Miller

isdn/capi: Return proper errnos on module init.

cdebug_init() is called from kcapi_init() which is module
initialization function, so it must return negative values on errors.
Signed-off-by: NMarcin Slusarz <marcin.slusarz@gmail.com>
Acked-by: NKarsten Keil <kkeil@suse.de>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 ffd8211f
...@@ -948,17 +948,17 @@ int __init cdebug_init(void) ...@@ -948,17 +948,17 @@ int __init cdebug_init(void)
{ {
g_cmsg= kmalloc(sizeof(_cmsg), GFP_KERNEL); g_cmsg= kmalloc(sizeof(_cmsg), GFP_KERNEL);
if (!g_cmsg) if (!g_cmsg)
return ENOMEM; return -ENOMEM;
g_debbuf = kmalloc(sizeof(_cdebbuf), GFP_KERNEL); g_debbuf = kmalloc(sizeof(_cdebbuf), GFP_KERNEL);
if (!g_debbuf) { if (!g_debbuf) {
kfree(g_cmsg); kfree(g_cmsg);
return ENOMEM; return -ENOMEM;
} }
g_debbuf->buf = kmalloc(CDEBUG_GSIZE, GFP_KERNEL); g_debbuf->buf = kmalloc(CDEBUG_GSIZE, GFP_KERNEL);
if (!g_debbuf->buf) { if (!g_debbuf->buf) {
kfree(g_cmsg); kfree(g_cmsg);
kfree(g_debbuf); kfree(g_debbuf);
return ENOMEM;; return -ENOMEM;;
} }
g_debbuf->size = CDEBUG_GSIZE; g_debbuf->size = CDEBUG_GSIZE;
g_debbuf->buf[0] = 0; g_debbuf->buf[0] = 0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册