Commit 066b2118 authored by Marcin Slusarz's avatar Marcin Slusarz Committed by 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: default avatarMarcin Slusarz <marcin.slusarz@gmail.com>
Acked-by: default avatarKarsten Keil <kkeil@suse.de>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 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%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment