Skip to content

Commit

Permalink
isdn/capi: Return proper errnos on module init.
Browse files Browse the repository at this point in the history
cdebug_init() is called from kcapi_init() which is module
initialization function, so it must return negative values on errors.

Signed-off-by: Marcin Slusarz <marcin.slusarz@gmail.com>
Acked-by: Karsten Keil <kkeil@suse.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Marcin Slusarz authored and David S. Miller committed May 15, 2008
1 parent ffd8211 commit 066b211
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions drivers/isdn/capi/capiutil.c
Original file line number Diff line number Diff line change
Expand Up @@ -948,17 +948,17 @@ int __init cdebug_init(void)
{
g_cmsg= kmalloc(sizeof(_cmsg), GFP_KERNEL);
if (!g_cmsg)
return ENOMEM;
return -ENOMEM;
g_debbuf = kmalloc(sizeof(_cdebbuf), GFP_KERNEL);
if (!g_debbuf) {
kfree(g_cmsg);
return ENOMEM;
return -ENOMEM;
}
g_debbuf->buf = kmalloc(CDEBUG_GSIZE, GFP_KERNEL);
if (!g_debbuf->buf) {
kfree(g_cmsg);
kfree(g_debbuf);
return ENOMEM;;
return -ENOMEM;;
}
g_debbuf->size = CDEBUG_GSIZE;
g_debbuf->buf[0] = 0;
Expand Down

0 comments on commit 066b211

Please sign in to comment.