Skip to contentSkip to conversation

isdn/capi: return proper errnos on module init

PATCH New Marcin Slusarz 1 participant 1 message May 11, 2008

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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

---
compile tested only

---
 drivers/isdn/capi/capiutil.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
drivers/isdn/capi/capiutil.c +3 -3
@@ -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;